diff options
Diffstat (limited to 'arch/powerpc/kernel/sys_ppc32.c')
-rw-r--r-- | arch/powerpc/kernel/sys_ppc32.c | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 81c570633ead..abd1112da54f 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -143,48 +143,17 @@ long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t pt | |||
143 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | 143 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) |
144 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | 144 | * and the register representation of a signed int (msr in 64-bit mode) is performed. |
145 | */ | 145 | */ |
146 | asmlinkage long compat_sys_sendfile(u32 out_fd, u32 in_fd, compat_off_t __user * offset, u32 count) | 146 | asmlinkage long compat_sys_sendfile_wrapper(u32 out_fd, u32 in_fd, |
147 | compat_off_t __user *offset, u32 count) | ||
147 | { | 148 | { |
148 | mm_segment_t old_fs = get_fs(); | 149 | return compat_sys_sendfile((int)out_fd, (int)in_fd, offset, count); |
149 | int ret; | ||
150 | off_t of; | ||
151 | off_t __user *up; | ||
152 | |||
153 | if (offset && get_user(of, offset)) | ||
154 | return -EFAULT; | ||
155 | |||
156 | /* The __user pointer cast is valid because of the set_fs() */ | ||
157 | set_fs(KERNEL_DS); | ||
158 | up = offset ? (off_t __user *) &of : NULL; | ||
159 | ret = sys_sendfile((int)out_fd, (int)in_fd, up, count); | ||
160 | set_fs(old_fs); | ||
161 | |||
162 | if (offset && put_user(of, offset)) | ||
163 | return -EFAULT; | ||
164 | |||
165 | return ret; | ||
166 | } | 150 | } |
167 | 151 | ||
168 | asmlinkage int compat_sys_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, s32 count) | 152 | asmlinkage long compat_sys_sendfile64_wrapper(u32 out_fd, u32 in_fd, |
153 | compat_loff_t __user *offset, u32 count) | ||
169 | { | 154 | { |
170 | mm_segment_t old_fs = get_fs(); | 155 | return sys_sendfile((int)out_fd, (int)in_fd, |
171 | int ret; | 156 | (off_t __user *)offset, count); |
172 | loff_t lof; | ||
173 | loff_t __user *up; | ||
174 | |||
175 | if (offset && get_user(lof, offset)) | ||
176 | return -EFAULT; | ||
177 | |||
178 | /* The __user pointer cast is valid because of the set_fs() */ | ||
179 | set_fs(KERNEL_DS); | ||
180 | up = offset ? (loff_t __user *) &lof : NULL; | ||
181 | ret = sys_sendfile64(out_fd, in_fd, up, count); | ||
182 | set_fs(old_fs); | ||
183 | |||
184 | if (offset && put_user(lof, offset)) | ||
185 | return -EFAULT; | ||
186 | |||
187 | return ret; | ||
188 | } | 157 | } |
189 | 158 | ||
190 | long compat_sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, | 159 | long compat_sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, |