linux-brain/arch/parisc
John David Anglin 03d1bba87a parisc: Fix validity check of pointer size argument in new CAS implementation
commit 05f016d2ca upstream.

As noted by Christoph Biedl, passing a pointer size of 4 in the new CAS
implementation causes a kernel crash.  The attached patch corrects the
off by one error in the argument validity check.

In reviewing the code, I noticed that we only perform word operations
with the pointer size argument.  The subi instruction intentionally uses
a word condition on 64-bit kernels.  Nullification was used instead of a
cmpib instruction as the branch should never be taken.  The shlw
pseudo-operation generates a depw,z instruction and it clears the target
before doing a shift left word deposit.  Thus, we don't need to clip the
upper 32 bits of this argument on 64-bit kernels.

Tested with a gcc testsuite run with a 64-bit kernel.  The gcc atomic
code in libgcc is the only direct user of the new CAS implementation
that I am aware of.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:39:08 +00:00
..
configs mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2016-08-30 10:10:21 -07:00
include parisc/mm: Ensure IRQs are off in switch_mm() 2017-07-21 07:42:20 +02:00
kernel parisc: Fix validity check of pointer size argument in new CAS implementation 2017-11-30 08:39:08 +00:00
lib parisc: fix bugs in pa_memcpy 2017-04-21 09:31:20 +02:00
math-emu parisc: Fix typo in fpudispatch.c 2016-05-22 22:29:07 +02:00
mm parisc: Report SIGSEGV instead of SIGBUS when running out of stack 2017-07-21 07:42:20 +02:00
oprofile oprofile: more whitespace fixes 2008-10-15 20:55:51 +02:00
Kconfig parisc: Switch to generic sched_clock implementation 2016-11-25 12:31:58 +01:00
Kconfig.debug parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
Makefile parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
defpalo.conf parisc: switch to gzip-compressed vmlinuz kernel 2013-07-09 22:09:20 +02:00
install.sh parisc: make "make install" not depend on vmlinux 2013-11-07 22:28:06 +01:00
nm Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00