linux-brain/arch/parisc/kernel
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
..
.gitignore parisc: add arch/parisc/kernel/.gitignore 2008-10-10 16:32:28 +00:00
Makefile parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
asm-offsets.c parisc: Unbreak handling exceptions from kernel modules 2016-04-08 22:14:14 +02:00
audit.c parisc: add kernel audit feature 2013-11-07 22:27:20 +01:00
binfmt_elf32.c parisc: fix redefinition of SET_PERSONALITY 2013-03-02 20:15:28 +01:00
cache.c parisc: Handle vma's whose context is not current in flush_cache_range 2017-08-11 08:49:27 -07:00
compat_audit.c parisc: add kernel audit feature 2013-11-07 22:27:20 +01:00
drivers.c parisc: use KERN_CONT when printing device inventory 2016-11-02 23:04:46 +01:00
entry.S parisc: Add cfi_startproc and cfi_endproc to assembly code 2016-10-05 22:54:40 +02:00
firmware.c parisc: Add break statements to pdc_pat_io_pci_cfg_read() 2016-08-02 16:44:33 +02:00
ftrace.c ftrace: Add return address pointer to ftrace_ret_stack 2016-08-24 12:15:14 +02:00
hardware.c parisc: add serial ports of C8000/1GHz machine to hardware database 2014-07-13 15:51:58 +02:00
head.S parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
hpmc.S parisc: Add cfi_startproc and cfi_endproc to assembly code 2016-10-05 22:54:40 +02:00
inventory.c parisc: Fix printk continuations in system detection 2016-11-22 18:09:33 +01:00
irq.c parisc: Filter out spurious interrupts in PA-RISC irq handler 2015-09-08 15:31:16 +02:00
module.c parisc: Handle R_PARISC_PCREL32 relocations in kernel modules 2016-04-08 22:10:35 +02:00
pa7300lc.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pacache.S parisc: Remove unnecessary TLB purges from flush_dcache_page_asm and flush_icache_page_asm 2016-12-07 09:01:21 +01:00
parisc_ksyms.c parisc: Clean up fixup routines for get_user()/put_user() 2017-04-08 09:30:34 +02:00
pci-dma.c parisc: Fix race in pci-dma.c 2016-11-25 12:31:59 +01:00
pci.c parisc: Initialize PCI bridge cache line and default latency 2016-01-12 22:03:21 +01:00
pdc_chassis.c parisc: single_open() leaks 2013-05-05 00:10:41 -04:00
pdc_cons.c parisc: don't use module_init for non-modular core pdc_cons code 2015-06-16 14:12:30 -04:00
perf.c parisc: perf: Fix potential NULL pointer dereference 2017-10-08 10:26:10 +02:00
perf_asm.S Revert "parisc: fix trivial section name warnings" 2008-06-13 10:49:45 -04:00
perf_images.h [PARISC] Use kzalloc and other janitor-style cleanups 2006-01-22 20:26:31 -05:00
process.c parisc: Suspend lockup detectors before system halt 2017-08-06 18:59:40 -07:00
processor.c parisc: Fix automatic selection of cr16 clocksource 2016-08-20 13:33:51 +02:00
ptrace.c parisc/ptrace: run seccomp after ptrace 2016-06-14 10:54:44 -07:00
real2.S parisc: Add cfi_startproc and cfi_endproc to assembly code 2016-10-05 22:54:40 +02:00
setup.c parisc: Fix races in parisc_setup_cache_timing() 2016-11-25 12:31:57 +01:00
signal.c parisc: Fix syscall restarts 2015-12-21 10:16:18 +01:00
signal32.c parisc: Fix SIGSYS signals in compat case 2016-03-31 12:28:37 +02:00
signal32.h constify copy_siginfo_to_user{,32}() 2013-11-09 00:16:29 -05:00
smp.c parisc: Check return value of smp_boot_one_cpu() 2016-09-20 18:02:36 +02:00
stacktrace.c parisc: add LATENCYTOP_SUPPORT and CONFIG_STACKTRACE_SUPPORT 2009-03-31 02:51:34 +00:00
sys_parisc.c mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
sys_parisc32.c parisc: drop unused defines and header includes 2014-07-13 15:56:12 +02:00
syscall.S parisc: Fix validity check of pointer size argument in new CAS implementation 2017-11-30 08:39:08 +00:00
syscall_table.S parisc: use compat_sys_keyctl() 2017-07-21 07:42:20 +02:00
time.c parisc: Mark cr16 clocksource unstable on SMP systems 2017-01-12 11:39:06 +01:00
topology.c parisc: Replace NR_CPUS in parisc code 2009-01-05 19:09:02 +00:00
traps.c parisc: Show trap name in kernel crash 2016-10-11 20:52:47 +02:00
unaligned.c parisc: Move die_if_kernel() prototype into traps.h header 2016-06-05 08:49:01 +02:00
unwind.c parisc: Fix backtrace on PA-RISC 2016-06-04 22:05:07 +02:00
vmlinux.lds.S parisc: Move exception table into read-only section 2016-10-09 13:29:07 +02:00