lkml.org 
[lkml]   [2007]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RESEND] PIE randomization
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 <jakub@redhat.com>
[ ... ]
> - 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 <jkosina@suse.cz>

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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-09 13:39    [W:0.079 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site