Commit efb455d8 authored by Heiko Carstens's avatar Heiko Carstens Committed by sanglipeng
Browse files

s390/uaccess: add missing earlyclobber annotations to __clear_user()

stable inclusion
from stable-v5.10.177
commit 3eeff8d26c6dceeaf10b552e8a5ce9010d818f41
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3eeff8d26c6dceeaf10b552e8a5ce9010d818f41



--------------------------------

commit 89aba4c2 upstream.

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: 6c2a9e6d ("[S390] Use alternative user-copy operations for new hardware.")
Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/all/20230321122514.1743889-3-mark.rutland@arm.com/


Cc: stable@vger.kernel.org
Reviewed-by: default avatarGerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 263add30
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -339,7 +339,7 @@ static inline unsigned long clear_user_mvcos(void __user *to, unsigned long size
		"4: slgr  %0,%0\n"
		"4: slgr  %0,%0\n"
		"5:\n"
		"5:\n"
		EX_TABLE(0b,2b) EX_TABLE(3b,5b)
		EX_TABLE(0b,2b) EX_TABLE(3b,5b)
		: "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2)
		: "+&a" (size), "+&a" (to), "+a" (tmp1), "=&a" (tmp2)
		: "a" (empty_zero_page), "d" (reg0) : "cc", "memory");
		: "a" (empty_zero_page), "d" (reg0) : "cc", "memory");
	return size;
	return size;
}
}