public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Elvira Khabirova <lineprinter@altlinux.org>,
	Eugene Syromyatnikov <evgsyr@gmail.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390: fix syscall_get_error for compat processes
Date: Tue, 16 Jun 2020 15:24:57 +0200	[thread overview]
Message-ID: <20200616132457.GA4166@osiris> (raw)
In-Reply-To: <20200602180051.GA2427@altlinux.org>

On Tue, Jun 02, 2020 at 09:00:51PM +0300, Dmitry V. Levin wrote:
> If both the tracer and the tracee are compat processes, and gprs[2]
> is assigned a value by __poke_user_compat, then the higher 32 bits
> of gprs[2] are cleared, IS_ERR_VALUE() always returns false, and
> syscall_get_error() always returns 0.
> 
> Fix the implementation by sign-extending the value for compat processes
> the same way as x86 implementation does.
> 
> The bug was exposed to user space by commit 201766a20e30f ("ptrace: add
> PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite.
> 
> This change fixes strace syscall tampering on s390.
> 
> Fixes: 753c4dd6a2fa2 ("[S390] ptrace changes")
> Cc: Elvira Khabirova <lineprinter@altlinux.org>
> Cc: stable@vger.kernel.org # v2.6.28+
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  arch/s390/include/asm/syscall.h | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Applied, thank you!

      reply	other threads:[~2020-06-16 13:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 18:00 [PATCH] s390: fix syscall_get_error for compat processes Dmitry V. Levin
2020-06-16 13:24 ` Heiko Carstens [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200616132457.GA4166@osiris \
    --to=heiko.carstens@de.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=evgsyr@gmail.com \
    --cc=gor@linux.ibm.com \
    --cc=ldv@altlinux.org \
    --cc=lineprinter@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox