Skip to content

Commit 1763fa5

Browse files
committed
s390, s390x: fix printing of syscalls unknown to the kernel
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.
1 parent e2136d4 commit 1763fa5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Noteworthy changes in release ?.?? (????-??-??)
1111
* Fixed build on arc, metag, nios2, or1k, and tile architectures.
1212
* Fixed decoding of 32-bit times syscall return value on 64-bit architectures.
1313
* Fixed decoding of mlock2 syscall on sparc.
14+
* Fixed decoding of syscalls unknown to the kernel on s390/s390x.
15+
(addresses Debian bug #485979 and Fedora bug #1298294).
1416

1517
Noteworthy changes in release 4.11 (2015-12-21)
1618
===============================================

linux/s390/get_scno.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
static int
33
arch_get_scno(struct tcb *tcp)
44
{
5-
tcp->scno = s390_regset.gprs[2];
5+
tcp->scno = s390_regset.gprs[2] ?
6+
s390_regset.gprs[2] : s390_regset.gprs[1];
67
return 1;
78
}

0 commit comments

Comments
 (0)