Re: Is it legal to return positive value when do_execve() succeeds?
From: KOSAKI Motohiro
Date: Mon Oct 04 2010 - 01:00:16 EST
> Thus, TASK_SIZE == 0xC0000000.
>
> fs/binfmt_elf.c:
> 77 #define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE)
> 78
> 79 static int set_brk(unsigned long start, unsigned long end)
> 80 {
> 81 start = ELF_PAGEALIGN(start);
> 82 end = ELF_PAGEALIGN(end);
> 83 if (end > start) {
> 84 unsigned long addr;
> 85 down_write(¤t->mm->mmap_sem);
> 86 addr = do_brk(start, end - start);
> 87 up_write(¤t->mm->mmap_sem);
> 88 if (BAD_ADDR(addr))
> 89 return addr;
> 90 }
> 91 current->mm->start_brk = current->mm->brk = end;
> 92 return 0;
> 93 }
>
> Thus, BAD_ADDR(x) is ((unsigned long)(x) >= 0xC0000000).
Can do_brk() return BAD_ADDR() _and_ !IS_ERR_VALUE() value? when?
--
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/