Commit b7707351 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390 update (11/27): 31 bit emulation.

Fix bug in 31 bit emulation of sys_msgsnd and rename sys32_pread/sys32_pwrite
to sys32_pread64/sys32_pwrite64.
parent 8bf69f6f
...@@ -514,16 +514,15 @@ static int do_sys32_msgsnd (int first, int second, int third, void *uptr) ...@@ -514,16 +514,15 @@ static int do_sys32_msgsnd (int first, int second, int third, void *uptr)
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
err = -EINVAL;
if (second > MSGMAX || first < 0 || second < 0) if (second > MSGMAX || first < 0 || second < 0)
return -EINVAL; goto out;
err = -EFAULT; err = -EFAULT;
if (!uptr) if (!uptr)
goto out; goto out;
if (get_user (p->mtype, &up->mtype) ||
err = get_user (p->mtype, &up->mtype); __copy_from_user (p->mtext, &up->mtext, second))
err |= __copy_from_user (p->mtext, &up->mtext, second);
if (err)
goto out; goto out;
old_fs = get_fs (); old_fs = get_fs ();
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
...@@ -3993,13 +3992,13 @@ extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf, ...@@ -3993,13 +3992,13 @@ extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
typedef __kernel_ssize_t32 ssize_t32; typedef __kernel_ssize_t32 ssize_t32;
asmlinkage ssize_t32 sys32_pread(unsigned int fd, char *ubuf, asmlinkage ssize_t32 sys32_pread64(unsigned int fd, char *ubuf,
__kernel_size_t32 count, u32 poshi, u32 poslo) __kernel_size_t32 count, u32 poshi, u32 poslo)
{ {
return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
} }
asmlinkage ssize_t32 sys32_pwrite(unsigned int fd, char *ubuf, asmlinkage ssize_t32 sys32_pwrite64(unsigned int fd, char *ubuf,
__kernel_size_t32 count, u32 poshi, u32 poslo) __kernel_size_t32 count, u32 poshi, u32 poslo)
{ {
return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
......
...@@ -872,23 +872,23 @@ sys32_rt_sigqueueinfo_wrapper: ...@@ -872,23 +872,23 @@ sys32_rt_sigqueueinfo_wrapper:
#sys32_rt_sigsuspend_wrapper # done in rt_sigsuspend_glue #sys32_rt_sigsuspend_wrapper # done in rt_sigsuspend_glue
.globl sys32_pread_wrapper .globl sys32_pread64_wrapper
sys32_pread_wrapper: sys32_pread64_wrapper:
llgfr %r2,%r2 # unsigned int llgfr %r2,%r2 # unsigned int
llgtr %r3,%r3 # char * llgtr %r3,%r3 # char *
llgfr %r4,%r4 # size_t llgfr %r4,%r4 # size_t
llgfr %r5,%r5 # u32 llgfr %r5,%r5 # u32
llgfr %r6,%r6 # u32 llgfr %r6,%r6 # u32
jg sys32_pread # branch to system call jg sys32_pread64 # branch to system call
.globl sys32_pwrite_wrapper .globl sys32_pwrite64_wrapper
sys32_pwrite_wrapper: sys32_pwrite64_wrapper:
llgfr %r2,%r2 # unsigned int llgfr %r2,%r2 # unsigned int
llgtr %r3,%r3 # const char * llgtr %r3,%r3 # const char *
llgfr %r4,%r4 # size_t llgfr %r4,%r4 # size_t
llgfr %r5,%r5 # u32 llgfr %r5,%r5 # u32
llgfr %r6,%r6 # u32 llgfr %r6,%r6 # u32
jg sys32_pwrite # branch to system call jg sys32_pwrite64 # branch to system call
.globl sys32_chown16_wrapper .globl sys32_chown16_wrapper
sys32_chown16_wrapper: sys32_chown16_wrapper:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment