Re: Is it legal to return positive value when do_execve() succeeds?

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

 



> 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(&current->mm->mmap_sem);
>  86                 addr = do_brk(start, end - start);
>  87                 up_write(&current->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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux