diff options
-rw-r--r-- | fs/binfmt_aout.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 15d80bb35d6f..9b6aef0f75e5 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -75,14 +75,16 @@ static int aout_core_dump(struct coredump_params *cprm) | |||
75 | struct file *file = cprm->file; | 75 | struct file *file = cprm->file; |
76 | mm_segment_t fs; | 76 | mm_segment_t fs; |
77 | int has_dumped = 0; | 77 | int has_dumped = 0; |
78 | unsigned long dump_start, dump_size; | 78 | void __user *dump_start; |
79 | int dump_size; | ||
79 | struct user dump; | 80 | struct user dump; |
80 | #ifdef __alpha__ | 81 | #ifdef __alpha__ |
81 | # define START_DATA(u) (u.start_data) | 82 | # define START_DATA(u) ((void __user *)u.start_data) |
82 | #else | 83 | #else |
83 | # define START_DATA(u) ((u.u_tsize << PAGE_SHIFT) + u.start_code) | 84 | # define START_DATA(u) ((void __user *)((u.u_tsize << PAGE_SHIFT) + \ |
85 | u.start_code)) | ||
84 | #endif | 86 | #endif |
85 | # define START_STACK(u) (u.start_stack) | 87 | # define START_STACK(u) ((void __user *)u.start_stack) |
86 | 88 | ||
87 | fs = get_fs(); | 89 | fs = get_fs(); |
88 | set_fs(KERNEL_DS); | 90 | set_fs(KERNEL_DS); |
@@ -104,9 +106,9 @@ static int aout_core_dump(struct coredump_params *cprm) | |||
104 | 106 | ||
105 | /* make sure we actually have a data and stack area to dump */ | 107 | /* make sure we actually have a data and stack area to dump */ |
106 | set_fs(USER_DS); | 108 | set_fs(USER_DS); |
107 | if (!access_ok(VERIFY_READ, (void __user *)START_DATA(dump), dump.u_dsize << PAGE_SHIFT)) | 109 | if (!access_ok(VERIFY_READ, START_DATA(dump), dump.u_dsize << PAGE_SHIFT)) |
108 | dump.u_dsize = 0; | 110 | dump.u_dsize = 0; |
109 | if (!access_ok(VERIFY_READ, (void __user *)START_STACK(dump), dump.u_ssize << PAGE_SHIFT)) | 111 | if (!access_ok(VERIFY_READ, START_STACK(dump), dump.u_ssize << PAGE_SHIFT)) |
110 | dump.u_ssize = 0; | 112 | dump.u_ssize = 0; |
111 | 113 | ||
112 | set_fs(KERNEL_DS); | 114 | set_fs(KERNEL_DS); |