diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-01-09 11:51:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 09:26:42 +0100 |
commit | fbf628a77f539b1907686f2c185f1df67eea3fdd (patch) | |
tree | 163085d040b1cc5aba428f27eb098e2af2fbafca /arch | |
parent | f3c19d08956e6d3337e29ee967fe54cf6fd860ed (diff) | |
download | linux-stable-fbf628a77f539b1907686f2c185f1df67eea3fdd.tar.gz linux-stable-fbf628a77f539b1907686f2c185f1df67eea3fdd.tar.bz2 linux-stable-fbf628a77f539b1907686f2c185f1df67eea3fdd.zip |
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
commit e3f360db08d55a14112bd27454e616a24296a8b0 upstream.
Make sure that *ptr__ within arch_this_cpu_to_op_simple() is only
dereferenced once by using READ_ONCE(). Otherwise the compiler could
generate incorrect code.
Cc: <stable@vger.kernel.org>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/include/asm/percpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h index 50f6661ba566..026a94b03a3c 100644 --- a/arch/s390/include/asm/percpu.h +++ b/arch/s390/include/asm/percpu.h @@ -31,7 +31,7 @@ pcp_op_T__ *ptr__; \ preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ - prev__ = *ptr__; \ + prev__ = READ_ONCE(*ptr__); \ do { \ old__ = prev__; \ new__ = old__ op (val); \ |