linux/arch/microblaze/kernel
Jamie Garside c2219eda54 microblaze: Fix syscall error recovery for invalid syscall IDs
This patch fixes two bugs in the Microblaze syscall trap handler when an invalid
syscall ID is used.

First, the range check on line 351 only checks for syscall IDs greater than
__NR_syscalls. A negative syscall ID (either passed to `syscall()` or as returned
by `do_syscall_trace_enter()` on error) will still satisfy this test and cause
the Linux kernel to access an invalid memory location and cause a kernel oops.
This has been fixed by also checking for r12 < 0.

Secondly, the current error recovery at line 378 returns using the wrong register
(r15 instead of r14) and does not restore the previous stack state. This has been
fixed by invoking `ret_from_trap` on error, setting r3 to `-ENOSYS`, similar to
what would happen when calling a valid syscall.

Signed-off-by: Jamie Garside <jamie.garside@york.ac.uk>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-03-04 15:12:27 +01:00
..
cpu microblaze: Add target architecture 2015-01-08 08:37:22 +01:00
.gitignore
Makefile microblaze: Remove unused prom_parse.c 2015-01-05 12:36:41 +01:00
asm-offsets.c
dma.c
early_printk.c
entry-nommu.S
entry.S microblaze: Fix syscall error recovery for invalid syscall IDs 2015-03-04 15:12:27 +01:00
exceptions.c
ftrace.c
head.S
heartbeat.c
hw_exception_handler.S
intc.c microblaze: intc: Reformat output 2015-01-08 08:37:24 +01:00
irq.c
kgdb.c microblaze: Use unsigned type for "for" loop because of comparison-kgdb.c 2015-01-05 12:36:45 +01:00
mcount.S
microblaze_ksyms.c
misc.S
module.c
platform.c
process.c
prom.c
ptrace.c microblaze: Use unsigned return type in do_syscall_trace_enter 2015-01-05 12:36:43 +01:00
reset.c microblaze: Remove unused prom header from reset.c 2015-01-05 12:36:42 +01:00
setup.c
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
stacktrace.c
sys_microblaze.c
syscall_table.S microblaze: Wire-up execveat syscall 2015-01-05 12:36:40 +01:00
timer.c microblaze: include the new timecounter header. 2015-01-02 16:47:36 -05:00
traps.c
unwind.c microblaze: Mark get_frame_size as static 2015-01-05 12:36:44 +01:00
vmlinux.lds.S