diff options
author | Helge Deller <deller@gmx.de> | 2015-12-21 12:03:30 +0300 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2016-10-26 18:15:41 +0300 |
commit | 5244151ef795a4d00b4fdb261a3bf68beb202246 (patch) | |
tree | e4365b162b6dfc23f83039b8f3a2d9cc82518f80 /Documentation/cachetlb.txt | |
parent | 87f4dcb8c9aeffa0b2ef13bc68401d50a3ffcec5 (diff) | |
download | linux-5244151ef795a4d00b4fdb261a3bf68beb202246.tar.xz |
parisc: Fix syscall restarts
commit 71a71fb5374a23be36a91981b5614590b9e722c3 upstream.
On parisc syscalls which are interrupted by signals sometimes failed to
restart and instead returned -ENOSYS which in the worst case lead to
userspace crashes.
A similiar problem existed on MIPS and was fixed by commit e967ef02
("MIPS: Fix restart of indirect syscalls").
On parisc the current syscall restart code assumes that all syscall
callers load the syscall number in the delay slot of the ble
instruction. That's how it is e.g. done in the unistd.h header file:
ble 0x100(%sr2, %r0)
ldi #syscall_nr, %r20
Because of that assumption the current code never restored %r20 before
returning to userspace.
This assumption is at least not true for code which uses the glibc
syscall() function, which instead uses this syntax:
ble 0x100(%sr2, %r0)
copy regX, %r20
where regX depend on how the compiler optimizes the code and register
usage.
This patch fixes this problem by adding code to analyze how the syscall
number is loaded in the delay branch and - if needed - copy the syscall
number to regX prior returning to userspace for the syscall restart.
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'Documentation/cachetlb.txt')
0 files changed, 0 insertions, 0 deletions