Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread James Morris
On Fri, 16 Nov 2007, Eric Paris wrote: > On Sat, 2007-11-17 at 08:42 +1100, James Morris wrote: > > On Fri, 16 Nov 2007, Eric Paris wrote: > > > > > +#ifdef CONFIG_SECURITY > > > + /* > > > + * If a hint addr is less than mmap_min_addr change addr to be as > > > + * low as possible but still

Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread Eric Paris
On Sat, 2007-11-17 at 08:42 +1100, James Morris wrote: > On Fri, 16 Nov 2007, Eric Paris wrote: > > > +#ifdef CONFIG_SECURITY > > + /* > > +* If a hint addr is less than mmap_min_addr change addr to be as > > +* low as possible but still greater than mmap_min_addr > > +*/ > > + if

Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread James Morris
On Fri, 16 Nov 2007, Eric Paris wrote: > +#ifdef CONFIG_SECURITY > + /* > + * If a hint addr is less than mmap_min_addr change addr to be as > + * low as possible but still greater than mmap_min_addr > + */ > + if (!(flags & MAP_FIXED) && ((void *)addr != NULL) && > +

[PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread Eric Paris
If mmap_min_addr is set and a process attempts to mmap (not fixed) with a non-null hint address less than mmap_min_addr the mapping will fail the security checks. Since this is just a hint address this patch will round such a hint address above mmap_min_addr. gcj was found to try to be very

[PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread Eric Paris
If mmap_min_addr is set and a process attempts to mmap (not fixed) with a non-null hint address less than mmap_min_addr the mapping will fail the security checks. Since this is just a hint address this patch will round such a hint address above mmap_min_addr. gcj was found to try to be very

Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread James Morris
On Fri, 16 Nov 2007, Eric Paris wrote: On Sat, 2007-11-17 at 08:42 +1100, James Morris wrote: On Fri, 16 Nov 2007, Eric Paris wrote: +#ifdef CONFIG_SECURITY + /* + * If a hint addr is less than mmap_min_addr change addr to be as + * low as possible but still greater than

Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread Eric Paris
On Sat, 2007-11-17 at 08:42 +1100, James Morris wrote: On Fri, 16 Nov 2007, Eric Paris wrote: +#ifdef CONFIG_SECURITY + /* +* If a hint addr is less than mmap_min_addr change addr to be as +* low as possible but still greater than mmap_min_addr +*/ + if (!(flags

Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr

2007-11-16 Thread James Morris
On Fri, 16 Nov 2007, Eric Paris wrote: +#ifdef CONFIG_SECURITY + /* + * If a hint addr is less than mmap_min_addr change addr to be as + * low as possible but still greater than mmap_min_addr + */ + if (!(flags MAP_FIXED) ((void *)addr != NULL) + (addr