]> granicus.if.org Git - strace/commitdiff
s390, s390x: fix printing of syscalls unknown to the kernel
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 13 Jan 2016 20:53:41 +0000 (20:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 13 Jan 2016 21:27:48 +0000 (21:27 +0000)
On s390/s390x, syscalls with NR up to 255 can be implemented
directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used.
The latter method is allowed for NR < 256, too.

When the syscall number specified directly or indirectly is recognized
by the kernel, i.e. it is less than its NR_syscalls value, it is stored
in %r2 and is available to arch_get_scno via s390_regset.gprs[2].
For syscall numbers >= NR_syscalls this register is set to 0,
but %r1 remains unchanged and could be used by arch_get_scno
via s390_regset.gprs[1] to decide what the syscall number is.

* linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero,
take syscall number from s390_regset.gprs[1].
* NEWS: Mention this fix.

This fixes Debian bug #485979 and Fedora bug #1298294.

NEWS
linux/s390/get_scno.c

diff --git a/NEWS b/NEWS
index f2ec02235050a2c479f143afecd639f98873000b..33fb3b08f3361acfa8204583672e2d8958cc654f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Noteworthy changes in release ?.?? (????-??-??)
   * Fixed build on arc, metag, nios2, or1k, and tile architectures.
   * Fixed decoding of 32-bit times syscall return value on 64-bit architectures.
   * Fixed decoding of mlock2 syscall on sparc.
+  * Fixed decoding of syscalls unknown to the kernel on s390/s390x.
+    (addresses Debian bug #485979 and Fedora bug #1298294).
 
 Noteworthy changes in release 4.11 (2015-12-21)
 ===============================================
index 8650e1f13f9c7dda35de7929b2dc0c1a90f9bb27..d323860d01204bbbb614f9c37f0fa4a36c90f697 100644 (file)
@@ -2,6 +2,7 @@
 static int
 arch_get_scno(struct tcb *tcp)
 {
-       tcp->scno = s390_regset.gprs[2];
+       tcp->scno = s390_regset.gprs[2] ?
+                   s390_regset.gprs[2] : s390_regset.gprs[1];
        return 1;
 }