Re: [patch 1/1] personality handling: fix PER_CLEAR_ON_SETID forsecurity reasons

From: Christoph Hellwig
Date: Sun Jun 28 2009 - 16:41:03 EST


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 :))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/