kernel_optimize_test/arch/arc/kernel
Vineet Gupta af9e5364c6 ARC: entry: fix off-by-one error in syscall number validation
commit 3433adc8bd09fc9f29b8baddf33b4ecd1ecd2cdc upstream.

We have NR_syscall syscalls from [0 .. NR_syscall-1].
However the check for invalid syscall number is "> NR_syscall" as
opposed to >=. This off-by-one error erronesously allows "NR_syscall"
to be treated as valid syscall causeing out-of-bounds access into
syscall-call table ensuing a crash (holes within syscall table have a
invalid-entry handler but this is beyond the array implementing the
table).

This problem showed up on v5.6 kernel when testing glibc 2.33 (v5.10
kernel capable, includng faccessat2 syscall 439). The v5.6 kernel has
NR_syscalls=439 (0 to 438). Due to the bug, 439 passed by glibc was
not handled as -ENOSYS but processed leading to a crash.

Link: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/48
Reported-by: Shahab Vahedi <shahab@synopsys.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-19 10:13:10 +02:00
..
.gitignore
arc_hostlink.c
arcksyms.c
asm-offsets.c
ctx_sw_asm.S
ctx_sw.c ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
devtree.c ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
disasm.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
entry-arcv2.S
entry-compact.S
entry.S ARC: entry: fix off-by-one error in syscall number validation 2021-05-19 10:13:10 +02:00
fpu.c
head.S ARC: [plat-hsdk] Remap CCMs super early in asm boot trampoline 2020-11-02 11:45:09 -08:00
intc-arcv2.c
intc-compact.c
irq.c
jump_label.c
kgdb.c
kprobes.c arc: kprobes: Use generic kretprobe trampoline handler 2020-09-08 11:52:32 +02:00
Makefile arc: ptrace: hard-code "arc" instead of UTS_MACHINE 2020-04-12 22:27:09 -07:00
mcip.c
module.c
perf_event.c ARC: perf: redo the pct irq missing in device-tree handling 2020-10-22 10:57:58 -07:00
process.c ARC: [plat-eznps]: Drop support for EZChip NPS platform 2020-10-05 21:02:29 -07:00
ptrace.c arc: switch to ->regset_get() 2020-07-27 14:31:09 -04:00
reset.c
setup.c ARCv2: boot log: detect newer/upconing HS3x/HS4x releases 2020-06-16 12:56:37 -07:00
signal.c arc: kernel: Return -EFAULT if copy_to_user() fails 2021-04-21 13:00:51 +02:00
smp.c ARC: SMP: fix typo and use "come up" instead of "comeup" 2020-10-05 21:02:29 -07:00
stacktrace.c ARC: stack unwinding: reorganize how initial register state setup 2020-11-17 20:12:01 -08:00
sys.c
traps.c
troubleshoot.c ARC: show_regs: fix r12 printing and simplify 2020-08-27 13:11:37 -07:00
unaligned.c
unwind.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
vmlinux.lds.S vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG 2020-09-01 09:50:35 +02:00