parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls
PATCH 1/1 parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls
Do not load one entry beyond the end of the syscall table when the syscall number of a traced process equals to __NR_Linux_syscalls. Similar bug with regular processes was fixed by commit 3bb457af4fa8 ("[PARISC] Fix bug when syscall nr is __NR_Linux_syscalls").
This bug was found by strace test suite.
--- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/syscall.S +1 -1
@@ -344,7 +344,7 @@ tracesys_next: #endif cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */ - comiclr,>>= __NR_Linux_syscalls, %r20, %r0 + comiclr,>> __NR_Linux_syscalls, %r20, %r0 b,n .Ltracesys_nosys LDREGX %r20(%r19), %r19
Signature · 1 line
ldv
Quoted 18 lines · Dmitry V. Levin
Do not load one entry beyond the end of the syscall table when the syscall number of a traced process equals to
__NR_Linux_syscalls. Similar bug with regular processes was fixed by commit3bb457af4fa8("[PARISC] Fix bug when syscall nr is__NR_Linux_syscalls").This bug was found by strace test suite.
Signed-off-by Dmitry V. Levin <[email protected]>--- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/parisc/kernel/syscall.S +0
-0
arch/parisc/kernel/syscall.S tracesys_next: · line 350
Quoted 8 lines
arch/parisc/kernel/syscall.S +1
-1@@ -344,7 +344,7 @@ tracesys_next: #endif cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */ - comiclr,>>= __NR_Linux_syscalls, %r20, %r0 + comiclr,>> __NR_Linux_syscalls, %r20, %r0 b,n .Ltracesys_nosys LDREGX %r20(%r19), %r19
i've deployd your fix to hake, so feel free to give the tests another run to try and crash the box :).
-mike
Quoted 26 lines · Mike Frysinger
Quoted 25 lines · Dmitry V. Levin
Do not load one entry beyond the end of the syscall table when the syscall number of a traced process equals to
__NR_Linux_syscalls. Similar bug with regular processes was fixed by commit3bb457af4fa8("[PARISC] Fix bug when syscall nr is__NR_Linux_syscalls").This bug was found by strace test suite.
Signed-off-by Dmitry V. Levin <[email protected]>--- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/parisc/kernel/syscall.S +1
-1@@ -344,7 +344,7 @@ tracesys_next: #endif cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */ - comiclr,>>= __NR_Linux_syscalls, %r20, %r0 + comiclr,>> __NR_Linux_syscalls, %r20, %r0 b,n .Ltracesys_nosys
Quoted 4 lines
arch/parisc/kernel/syscall.S tracesys_next: · line 350
Quoted 1 line
arch/parisc/kernel/syscall.S +0
-0LDREGX %r20(%r19), %r19i've deployd your fix to hake, so feel free to give the tests another run to try and crash the box :).
With this fix the box no longer crashes.
Signature · 1 line
ldv
Quoted 9 lines · Dmitry V. Levin
Do not load one entry beyond the end of the syscall table when the syscall number of a traced process equals to
__NR_Linux_syscalls. Similar bug with regular processes was fixed by commit3bb457af4fa8("[PARISC] Fix bug when syscall nr is__NR_Linux_syscalls").This bug was found by strace test suite.
Signed-off-by Dmitry V. Levin <[email protected]>
Thanks!
Helge
Quoted 18 lines
--- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/parisc/kernel/syscall.S +1
-1@@ -344,7 +344,7 @@ tracesys_next: #endif cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */ - comiclr,>>= __NR_Linux_syscalls, %r20, %r0 + comiclr,>> __NR_Linux_syscalls, %r20, %r0 b,n .Ltracesys_nosys LDREGX %r20(%r19), %r19