Messages in this thread | | | Date | Sun, 28 Jun 2009 16:40:46 -0400 | From | Christoph Hellwig <> | Subject | Re: [patch 1/1] personality handling: fix PER_CLEAR_ON_SETID for security reasons |
| |
On Fri, Jun 26, 2009 at 08:27:40PM +0200, Julien Tinnes wrote: > Hello, > > We have found that the current PER_CLEAR_ON_SETID mask on Linux > doesn't include neither ADDR_COMPAT_LAYOUT, nor MMAP_PAGE_ZERO. > > The current mask is READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE. > > We believe it is important to add MMAP_PAGE_ZERO, because by using > this personality it is possible to have the first page mapped inside a > process running as setuid root. This could be used in those scenarios:
I agree.
> Less importantly, we believe ADDR_COMPAT_LAYOUT should also be added > since on x86 32bits it will in practice disable most of the address > space layout randomization (only the stack will remain randomized).
Agree on this on, too.
> -#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE) > +#define PER_CLEAR_ON_SETID > (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE|ADDR_COMPAT_LAYOUT|MMAP_PAGE_ZERO)
#define PER_CLEAR_ON_SETID \ (READ_IMPLIES_EXEC | \ ADDR_NO_RANDOMIZE | \ ADDR_COMPAT_LAYOUT | \ MMAP_PAGE_ZERO)
to make it a little more readable (and work around your mailer corrupting long lines :))
| |