Re: [patch 0/5] Support for sanitization flag in low-level page allocator

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Friday, May 29, 2009 - 3:58 pm

On Wed, 20 May 2009 14:24:13 -0700
"Larry H." <research@subreption.com> wrote:


And your proposed approach requires that developers remember to use
GFP_SENSITIVE at allocation time.  In well-implemented code, there is a
single memory-freeing site, so there's really no difference here.

Other problems I see with the patch are:

- Adds a test-n-branch to all page-freeing operations.  Ouch.  The
  current approach avoids that cost.

- Fails to handle kmalloc()'ed memory.  Fixing this will probably
  require adding a test-n-branch to kmem_cache_alloc().  Ouch * N.

- Once kmalloc() is fixed, the page-allocator changes and
  GFP_SENSITIVE itself can perhaps go away - I expect that little
  security-sensitive memory is allocated direct from the page
  allocator.  Most callsites are probably using
  kmalloc()/kmem_cache_alloc() (might be wrong).

  If not wrong then we end up with a single requirement: zap the
  memory in kmem_cache_free().

  But how to do that?  Particular callsites don't get to alter
  kfree()'s behaviour.  So they'd need to use a new kfree_sensitive(). 
  Which is just syntactic sugar around the code whihc we presently
  implement.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Support for unconditional page sanitization, Larry H., (Sat May 23, 11:21 am)
Re: [PATCH] Support for unconditional page sanitization, Arjan van de Ven, (Sat May 23, 2:05 pm)
Re: [PATCH] Support for unconditional page sanitization, Arjan van de Ven, (Sun May 24, 9:38 am)
Re: [patch 0/5] Support for sanitization flag in low-level ..., Andrew Morton, (Fri May 29, 3:58 pm)