Lines 39-51
static struct linux_binfmt aout_format =
Link Here
|
39 |
NULL, THIS_MODULE, load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE |
39 |
NULL, THIS_MODULE, load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE |
40 |
}; |
40 |
}; |
41 |
|
41 |
|
42 |
static void set_brk(unsigned long start, unsigned long end) |
42 |
#define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE) |
|
|
43 |
|
44 |
static int set_brk(unsigned long start, unsigned long end) |
43 |
{ |
45 |
{ |
44 |
start = PAGE_ALIGN(start); |
46 |
start = PAGE_ALIGN(start); |
45 |
end = PAGE_ALIGN(end); |
47 |
end = PAGE_ALIGN(end); |
46 |
if (end <= start) |
48 |
if (end > start) { |
47 |
return; |
49 |
unsigned long addr = do_brk(start, end - start); |
48 |
do_brk(start, end - start); |
50 |
if (BAD_ADDR(addr)) |
|
|
51 |
return addr; |
52 |
} |
53 |
return 0; |
49 |
} |
54 |
} |
50 |
|
55 |
|
51 |
/* |
56 |
/* |
Lines 405-411
static int load_aout_binary(struct linux
Link Here
|
405 |
beyond_if: |
410 |
beyond_if: |
406 |
set_binfmt(&aout_format); |
411 |
set_binfmt(&aout_format); |
407 |
|
412 |
|
408 |
set_brk(current->mm->start_brk, current->mm->brk); |
413 |
retval = set_brk(current->mm->start_brk, current->mm->brk); |
|
|
414 |
if (retval < 0) { |
415 |
send_sig(SIGKILL, current, 0); |
416 |
return retval; |
417 |
} |
409 |
|
418 |
|
410 |
retval = setup_arg_pages(bprm); |
419 |
retval = setup_arg_pages(bprm); |
411 |
if (retval < 0) { |
420 |
if (retval < 0) { |