From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:60839 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbdJHVYV (ORCPT ); Sun, 8 Oct 2017 17:24:21 -0400 Message-ID: <1507497850.2677.98.camel@decadent.org.uk> Subject: Re: [PATCH] s390/seccomp: fix error return for filtered system calls From: Ben Hutchings To: Michael Holzheu , stable@vger.kernel.org Cc: Martin Schwidefsky , Heiko Carstens Date: Sun, 08 Oct 2017 22:24:10 +0100 In-Reply-To: <20160725161616.5bb17866@TP-holzheu> References: <20160725161616.5bb17866@TP-holzheu> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Yrcx0FknH1i1F5t6uj1X" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-Yrcx0FknH1i1F5t6uj1X Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2016-07-25 at 16:16 +0200, Michael Holzheu wrote: > commit dc295880c6752076f8b94ba3885d0bfff09e3e82 upstream >=20 > The syscall_set_return_value function of s390 negates the error argument > before storing the value to the return register gpr2. This is incorrect, > the seccomp code already passes the negative error value. > Store the unmodified error value to gpr2. >=20 > Signed-off-by: Jan Willeke > Signed-off-by: Martin Schwidefsky > --- > * Requested versions for stable: v2.6.28 - v3.16 Belatedly queued this up for 3.16. Ben. > * Justification: Patch is needed e.g. for Docker seccomp support on > kernels with version < 3.17. > * Bug was introduced by commit: 753c4dd6a2fa2af "[S390] ptrace changes"= =20 > --- > arch/s390/include/asm/syscall.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/arch/s390/include/asm/syscall.h > b/arch/s390/include/asm/syscall.h index abad78d..5bc1259 100644 > --- a/arch/s390/include/asm/syscall.h > +++ b/arch/s390/include/asm/syscall.h > @@ -54,7 +54,7 @@ static inline void syscall_set_return_value(struct > task_struct *task, struct pt_regs *regs, > int error, long val) > { > - regs->gprs[2] =3D error ? -error : val; > + regs->gprs[2] =3D error ? error : val; > } > =20 > static inline void syscall_get_arguments(struct task_struct *task, --=20 Ben Hutchings compatible: Gracefully accepts erroneous data from any source --=-Yrcx0FknH1i1F5t6uj1X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAlnal3oACgkQ57/I7JWG EQlD5w//cUavRS0ObHQQN6aHTMZjBqM0/aYqvoJMHdyokcZlL5mHDeYvsIwVF4UC 5iIe2E2vw3dskYR9ZsqxHmZ8FPOlL9h7F8W23ECiemdVvl0p0dK+zlFBMfdlLOuX xML/9LEnujFdUOEmZG4kh/gYcrHwqbcUFXEyybF8SHdPlZr9SwSieaYm+E7Cgn91 +0MSE8A7i/ATAuvYILt+3hNBps5F9VdriP/pzSyM4TFbPQkVWLgx6E71l/9Q0kKz YFoHnl5jYfehjUlJfSPMbo6k1O1j09YoBIoSdxdxpNC1ZEu7r0Q2H/sGvpRlaQMM NItZRucsf1tvg0p0VcWhshLtTzV0E0m0gIe/HWEb7kyUq9PegyIUM+MaY40p1+rm sLCFSaw/KYv+Dbu7s2Oj2WB1TiPSkx9fVsgS6OME7WtCYLvkGOpvhHWOn8gdfxFG +UKC8Vamzbd9dxAJLqBxYDQDWmbi2r8hnw2DmwiLR67x9PUYnd9ny6Ka4llq1XxU tLntHz0tdR6HhjQsXKfv1rEsetOGclzarceSXi4XuUDE6SuleA46zt34gbJJIlGX ubqcc0xsyHl2oJX9ljTCewjxxGyCbXkuy/seDkDPJoudK+m8SV3fuq5ufaypk5KL YwdH76ZGGWEHG8SyZrS2XiEI61Q46g26hj63TSaZvByD8IXUzwU= =mdQA -----END PGP SIGNATURE----- --=-Yrcx0FknH1i1F5t6uj1X--