]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 04:27:05 +0000 (20:27 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 04:27:05 +0000 (20:27 -0800)
added patches:
compat-fix-sys_fanotify_mark.patch
fs-compat-fix-lookup_dcookie-parameter-handling.patch
fs-compat-fix-parameter-handling-for-compat-readv-writev-syscalls.patch

queue-3.12/compat-fix-sys_fanotify_mark.patch [new file with mode: 0644]
queue-3.12/fs-compat-fix-lookup_dcookie-parameter-handling.patch [new file with mode: 0644]
queue-3.12/fs-compat-fix-parameter-handling-for-compat-readv-writev-syscalls.patch [new file with mode: 0644]
queue-3.12/series

diff --git a/queue-3.12/compat-fix-sys_fanotify_mark.patch b/queue-3.12/compat-fix-sys_fanotify_mark.patch
new file mode 100644 (file)
index 0000000..e2cd5fc
--- /dev/null
@@ -0,0 +1,48 @@
+From 592f6b842f64e416c7598a1b97c649b34241e22d Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Mon, 27 Jan 2014 17:07:19 -0800
+Subject: compat: fix sys_fanotify_mark
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit 592f6b842f64e416c7598a1b97c649b34241e22d upstream.
+
+Commit 91c2e0bcae72 ("unify compat fanotify_mark(2), switch to
+COMPAT_SYSCALL_DEFINE") added a new unified compat fanotify_mark syscall
+to be used by all architectures.
+
+Unfortunately the unified version merges the split mask parameter in a
+wrong way: the lower and higher word got swapped.
+
+This was discovered with glibc's tst-fanotify test case.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Reported-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
+Acked-by: "David S. Miller" <davem@davemloft.net>
+Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
+Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/notify/fanotify/fanotify_user.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/notify/fanotify/fanotify_user.c
++++ b/fs/notify/fanotify/fanotify_user.c
+@@ -888,9 +888,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
+ {
+       return sys_fanotify_mark(fanotify_fd, flags,
+ #ifdef __BIG_ENDIAN
+-                              ((__u64)mask1 << 32) | mask0,
+-#else
+                               ((__u64)mask0 << 32) | mask1,
++#else
++                              ((__u64)mask1 << 32) | mask0,
+ #endif
+                                dfd, pathname);
+ }
diff --git a/queue-3.12/fs-compat-fix-lookup_dcookie-parameter-handling.patch b/queue-3.12/fs-compat-fix-lookup_dcookie-parameter-handling.patch
new file mode 100644 (file)
index 0000000..2e8f373
--- /dev/null
@@ -0,0 +1,54 @@
+From d8d14bd09cddbaf0168d61af638455a26bd027ff Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Wed, 29 Jan 2014 14:05:46 -0800
+Subject: fs/compat: fix lookup_dcookie() parameter handling
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit d8d14bd09cddbaf0168d61af638455a26bd027ff upstream.
+
+Commit d5dc77bfeeab ("consolidate compat lookup_dcookie()") coverted all
+architectures to the new compat_sys_lookup_dcookie() syscall.
+
+The "len" paramater of the new compat syscall must have the type
+compat_size_t in order to enforce zero extension for architectures where
+the ABI requires that the caller of a function performed zero and/or
+sign extension to 64 bit of all parameters.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Ingo Molnar <mingo@kernel.org>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/dcookies.c          |    2 +-
+ include/linux/compat.h |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/dcookies.c
++++ b/fs/dcookies.c
+@@ -204,7 +204,7 @@ out:
+ }
+ #ifdef CONFIG_COMPAT
+-COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, size_t, len)
++COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, compat_size_t, len)
+ {
+ #ifdef __BIG_ENDIAN
+       return sys_lookup_dcookie(((u64)w0 << 32) | w1, buf, len);
+--- a/include/linux/compat.h
++++ b/include/linux/compat.h
+@@ -422,7 +422,7 @@ extern long compat_arch_ptrace(struct ta
+ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
+                                 compat_long_t addr, compat_long_t data);
+-asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t);
++asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
+ /*
+  * epoll (fs/eventpoll.c) compat bits follow ...
+  */
diff --git a/queue-3.12/fs-compat-fix-parameter-handling-for-compat-readv-writev-syscalls.patch b/queue-3.12/fs-compat-fix-parameter-handling-for-compat-readv-writev-syscalls.patch
new file mode 100644 (file)
index 0000000..07bab29
--- /dev/null
@@ -0,0 +1,113 @@
+From dfd948e32af2e7b28bcd7a490c0a30d4b8df2a36 Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Wed, 29 Jan 2014 14:05:44 -0800
+Subject: fs/compat: fix parameter handling for compat readv/writev syscalls
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit dfd948e32af2e7b28bcd7a490c0a30d4b8df2a36 upstream.
+
+We got a report that the pwritev syscall does not work correctly in
+compat mode on s390.
+
+It turned out that with commit 72ec35163f9f ("switch compat readv/writev
+variants to COMPAT_SYSCALL_DEFINE") we lost the zero extension of a
+couple of syscall parameters because the some parameter types haven't
+been converted from unsigned long to compat_ulong_t.
+
+This is needed for architectures where the ABI requires that the caller
+of a function performed zero and/or sign extension to 64 bit of all
+parameters.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Ingo Molnar <mingo@kernel.org>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/read_write.c        |   16 ++++++++--------
+ include/linux/compat.h |   16 ++++++++--------
+ 2 files changed, 16 insertions(+), 16 deletions(-)
+
+--- a/fs/read_write.c
++++ b/fs/read_write.c
+@@ -977,9 +977,9 @@ out:
+       return ret;
+ }
+-COMPAT_SYSCALL_DEFINE3(readv, unsigned long, fd,
++COMPAT_SYSCALL_DEFINE3(readv, compat_ulong_t, fd,
+               const struct compat_iovec __user *,vec,
+-              unsigned long, vlen)
++              compat_ulong_t, vlen)
+ {
+       struct fd f = fdget(fd);
+       ssize_t ret;
+@@ -1014,9 +1014,9 @@ COMPAT_SYSCALL_DEFINE4(preadv64, unsigne
+       return ret;
+ }
+-COMPAT_SYSCALL_DEFINE5(preadv, unsigned long, fd,
++COMPAT_SYSCALL_DEFINE5(preadv, compat_ulong_t, fd,
+               const struct compat_iovec __user *,vec,
+-              unsigned long, vlen, u32, pos_low, u32, pos_high)
++              compat_ulong_t, vlen, u32, pos_low, u32, pos_high)
+ {
+       loff_t pos = ((loff_t)pos_high << 32) | pos_low;
+       return compat_sys_preadv64(fd, vec, vlen, pos);
+@@ -1044,9 +1044,9 @@ out:
+       return ret;
+ }
+-COMPAT_SYSCALL_DEFINE3(writev, unsigned long, fd,
++COMPAT_SYSCALL_DEFINE3(writev, compat_ulong_t, fd,
+               const struct compat_iovec __user *, vec,
+-              unsigned long, vlen)
++              compat_ulong_t, vlen)
+ {
+       struct fd f = fdget(fd);
+       ssize_t ret;
+@@ -1081,9 +1081,9 @@ COMPAT_SYSCALL_DEFINE4(pwritev64, unsign
+       return ret;
+ }
+-COMPAT_SYSCALL_DEFINE5(pwritev, unsigned long, fd,
++COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd,
+               const struct compat_iovec __user *,vec,
+-              unsigned long, vlen, u32, pos_low, u32, pos_high)
++              compat_ulong_t, vlen, u32, pos_low, u32, pos_high)
+ {
+       loff_t pos = ((loff_t)pos_high << 32) | pos_low;
+       return compat_sys_pwritev64(fd, vec, vlen, pos);
+--- a/include/linux/compat.h
++++ b/include/linux/compat.h
+@@ -327,16 +327,16 @@ asmlinkage long compat_sys_keyctl(u32 op
+                             u32 arg2, u32 arg3, u32 arg4, u32 arg5);
+ asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
+-asmlinkage ssize_t compat_sys_readv(unsigned long fd,
+-              const struct compat_iovec __user *vec, unsigned long vlen);
+-asmlinkage ssize_t compat_sys_writev(unsigned long fd,
+-              const struct compat_iovec __user *vec, unsigned long vlen);
+-asmlinkage ssize_t compat_sys_preadv(unsigned long fd,
++asmlinkage ssize_t compat_sys_readv(compat_ulong_t fd,
++              const struct compat_iovec __user *vec, compat_ulong_t vlen);
++asmlinkage ssize_t compat_sys_writev(compat_ulong_t fd,
++              const struct compat_iovec __user *vec, compat_ulong_t vlen);
++asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
+               const struct compat_iovec __user *vec,
+-              unsigned long vlen, u32 pos_low, u32 pos_high);
+-asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
++              compat_ulong_t vlen, u32 pos_low, u32 pos_high);
++asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd,
+               const struct compat_iovec __user *vec,
+-              unsigned long vlen, u32 pos_low, u32 pos_high);
++              compat_ulong_t vlen, u32 pos_low, u32 pos_high);
+ asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int);
+ asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
index 5b546b6037e70e72f863be8d0a6652f9ac0788a3..3522def074ec808a844b216c6515047c257cb46e 100644 (file)
@@ -28,3 +28,6 @@ slub-fix-calculation-of-cpu-slabs.patch
 turbostat-don-t-put-unprocessed-uapi-headers-in-the-include-path.patch
 turbostat-use-gcc-s-cpuid-functions-to-support-pic.patch
 acpi-init-flag-use-of-acpi-and-acpi-idioms-for-power-supplies-to-regulator-api.patch
+compat-fix-sys_fanotify_mark.patch
+fs-compat-fix-parameter-handling-for-compat-readv-writev-syscalls.patch
+fs-compat-fix-lookup_dcookie-parameter-handling.patch