Re: [PATCH][RESEND] PIE randomization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 7 Jul 2007, Jakub Jelinek wrote:

> I believe BAD_ADDR macro was changes from ((unsigned long)(x) >= 
> TASK_SIZE) (which is the right test for invalid user addresses, stronger 
> check than >= PAGE_MASK) to >= PAGE_MASK only because of the one check 
> of the return value of load_elf_interp.  

Yes, this is correct.

> All other uses of BAD_ADDR macro are either on userland addresses (what 
> do_mmap, elf_map, do_brk etc. return; where TASK_SIZE or more is 
> certainly wrong) 

True. But these functions are supposed to perform all the necessary checks 
and return ERR_PTR if anything fails, so everything is fine and nothing 
gets broken.

> or in one case still on unbiased ELF p_vaddr: if (BAD_ADDR(k) || 
> elf_ppnt->p_filesz > elf_ppnt->p_memsz || in load_elf_binary (where >= 
> TASK_SIZE check is ok too).
> So perhaps doing this instead of changing BAD_ADDR to IS_ERR_VAL
> might be better:
> Signed-off-by: Jakub Jelinek <[email protected]>
[ ... ]
> -			if (!BAD_ADDR(elf_entry)) {
> +			if (!IS_ERR((void *)elf_entry)) {

I agree that this is better solution. Andrew, this Jakub's patch should 
replace the pie-randomization-fix-bad_addr-macro.patch if possible. You 
can add 

Signed-off-by: Jiri Kosina <[email protected]>

if that makes any difference.

Thanks,

-- 
Jiri Kosina
SUSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux