From 7e310c64855fec33d29834ef9d5becb5742a123c Mon Sep 17 00:00:00 2001 From: Michal Koutný Date: Apr 05 2023 15:47:01 +0000 Subject: s390/uaccess: add missing earlyclobber annotations to __clear_user() (bsc#1209858). --- diff --git a/patches.suse/s390-uaccess-add-missing-earlyclobber-annotations-to-__clear_user.patch b/patches.suse/s390-uaccess-add-missing-earlyclobber-annotations-to-__clear_user.patch new file mode 100644 index 0000000..3d4797d --- /dev/null +++ b/patches.suse/s390-uaccess-add-missing-earlyclobber-annotations-to-__clear_user.patch @@ -0,0 +1,38 @@ +From: Heiko Carstens +Date: Thu, 23 Mar 2023 13:09:16 +0100 +Subject: s390/uaccess: add missing earlyclobber annotations to __clear_user() +Git-commit: 89aba4c26fae4e459f755a18912845c348ee48f3 +Patch-mainline: v6.3-rc5 +References: bsc#1209858 + +Add missing earlyclobber annotation to size, to, and tmp2 operands of the +__clear_user() inline assembly since they are modified or written to before +the last usage of all input operands. This can lead to incorrect register +allocation for the inline assembly. + +Fixes: 6c2a9e6df604 ("[S390] Use alternative user-copy operations for new hardware.") +Reported-by: Mark Rutland +Link: https://lore.kernel.org/all/20230321122514.1743889-3-mark.rutland@arm.com/ +Cc: stable@vger.kernel.org +Reviewed-by: Gerald Schaefer +Signed-off-by: Heiko Carstens +Signed-off-by: Vasily Gorbik +Acked-by: Michal Koutný +--- + arch/s390/lib/uaccess.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c +index 720036fb1924..d44214072779 100644 +--- a/arch/s390/lib/uaccess.c ++++ b/arch/s390/lib/uaccess.c +@@ -349,7 +349,7 @@ static inline unsigned long clear_user_m + "4: slgr %0,%0\n" + "5:\n" + EX_TABLE(0b,2b) EX_TABLE(6b,2b) EX_TABLE(3b,5b) EX_TABLE(7b,5b) +- : "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2) ++ : "+&a" (size), "+&a" (to), "+a" (tmp1), "=&a" (tmp2) + : "a" (empty_zero_page), [spec] "d" (spec.val) + : "cc", "memory", "0"); + return size; + diff --git a/series.conf b/series.conf index 12d40d7..26b9b17 100644 --- a/series.conf +++ b/series.conf @@ -36903,6 +36903,7 @@ patches.suse/ibmvnic-Assign-XPS-map-to-correct-queue-index.patch patches.suse/0001-net-tls-fix-possible-race-condition-between-do_tls_g.patch patches.suse/bnxt_en-Avoid-order-5-memory-allocation-for-TPA-data.patch + patches.suse/s390-uaccess-add-missing-earlyclobber-annotations-to-__clear_user.patch ######################################################## # end of sorted patches