]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Jan 2023 08:26:46 +0000 (09:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Jan 2023 08:26:46 +0000 (09:26 +0100)
added patches:
riscv-uaccess-fix-type-of-0-variable-on-error-in-get_user.patch

queue-5.4/riscv-uaccess-fix-type-of-0-variable-on-error-in-get_user.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/riscv-uaccess-fix-type-of-0-variable-on-error-in-get_user.patch b/queue-5.4/riscv-uaccess-fix-type-of-0-variable-on-error-in-get_user.patch
new file mode 100644 (file)
index 0000000..c026afb
--- /dev/null
@@ -0,0 +1,36 @@
+From b9b916aee6715cd7f3318af6dc360c4729417b94 Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben-linux@fluff.org>
+Date: Thu, 29 Dec 2022 17:05:45 +0000
+Subject: riscv: uaccess: fix type of 0 variable on error in get_user()
+
+From: Ben Dooks <ben-linux@fluff.org>
+
+commit b9b916aee6715cd7f3318af6dc360c4729417b94 upstream.
+
+If the get_user(x, ptr) has x as a pointer, then the setting
+of (x) = 0 is going to produce the following sparse warning,
+so fix this by forcing the type of 'x' when access_ok() fails.
+
+fs/aio.c:2073:21: warning: Using plain integer as NULL pointer
+
+Signed-off-by: Ben Dooks <ben-linux@fluff.org>
+Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
+Link: https://lore.kernel.org/r/20221229170545.718264-1-ben-linux@fluff.org
+Cc: stable@vger.kernel.org
+Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/riscv/include/asm/uaccess.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/riscv/include/asm/uaccess.h
++++ b/arch/riscv/include/asm/uaccess.h
+@@ -235,7 +235,7 @@ do {                                                               \
+       might_fault();                                          \
+       access_ok(__p, sizeof(*__p)) ?          \
+               __get_user((x), __p) :                          \
+-              ((x) = 0, -EFAULT);                             \
++              ((x) = (__force __typeof__(x))0, -EFAULT);      \
+ })
+ #define __put_user_asm(insn, x, ptr, err)                     \
index 2372116435696075e1d7094054308df6da70a5cf..e6558e0fb4404f766d0fc8531a034f6ea93a00f2 100644 (file)
@@ -590,3 +590,4 @@ udf-fix-extension-of-the-last-extent-in-the-file.patch
 asoc-intel-bytcr_rt5640-add-quirk-for-the-advantech-.patch
 x86-bugs-flush-ibp-in-ib_prctl_set.patch
 nfsd-fix-handling-of-readdir-in-v4root-vs.-mount-upcall-timeout.patch
+riscv-uaccess-fix-type-of-0-variable-on-error-in-get_user.patch