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.
This commit is contained in:
Дмитрий Левин 2016-01-13 20:53:41 +00:00
parent e2136d4b89
commit 1763fa5f62
2 changed files with 4 additions and 1 deletions

2
NEWS
View File

@ -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)
===============================================

View 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;
}