|
Lines 39-51
static struct linux_binfmt aout_format =
|
Link Here
|
|---|
|
NULL, THIS_MODULE, load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE | NULL, THIS_MODULE, load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE |
}; | }; |
| |
static void set_brk(unsigned long start, unsigned long end) |
#define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE) |
|
|
|
static int set_brk(unsigned long start, unsigned long end) |
{ | { |
start = PAGE_ALIGN(start); | start = PAGE_ALIGN(start); |
end = PAGE_ALIGN(end); | end = PAGE_ALIGN(end); |
if (end <= start) |
if (end > start) { |
return; |
unsigned long addr = do_brk(start, end - start); |
do_brk(start, end - start); |
if (BAD_ADDR(addr)) |
|
return addr; |
|
} |
|
return 0; |
} | } |
| |
/* | /* |
|
Lines 405-411
static int load_aout_binary(struct linux
|
Link Here
|
|---|
|
beyond_if: | beyond_if: |
set_binfmt(&aout_format); | set_binfmt(&aout_format); |
| |
set_brk(current->mm->start_brk, current->mm->brk); |
retval = set_brk(current->mm->start_brk, current->mm->brk); |
|
if (retval < 0) { |
|
send_sig(SIGKILL, current, 0); |
|
return retval; |
|
} |
| |
retval = setup_arg_pages(bprm); | retval = setup_arg_pages(bprm); |
if (retval < 0) { | if (retval < 0) { |