linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Rich Felker <dalias@libc.org>, linux-sh@vger.kernel.org
Cc: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>,
	linux-kernel@vger.kernel.org,
	Yoshinori Sato <ysato@users.sourceforge.jp>
Subject: Re: [PATCH] sh: fix syscall tracing
Date: Thu, 03 Sep 2020 08:13:43 +0000	[thread overview]
Message-ID: <65bf8a3b-8213-0a67-1156-043bca545ada@physik.fu-berlin.de> (raw)
In-Reply-To: <20200903054803.GX3265@brightrain.aerifal.cx>

Hi Rich!

On 9/3/20 7:48 AM, Rich Felker wrote:
> Addition of SECCOMP_FILTER exposed a longstanding bug in
> do_syscall_trace_enter, whereby r0 (the 5th argument register) was
> mistakenly used where r3 (syscall_nr) was intended. By overwriting r0
> rather than r3 with -1 when attempting to block a syscall, the
> existing code would instead have caused the syscall to execute with an
> argument clobbered.
> 
> Commit 0bb605c2c7f2b4b3 then introduced skipping of the syscall when
> do_syscall_trace_enter returns -1, so that the return value set by
> seccomp filters would not be clobbered by -ENOSYS. This eliminated the
> clobbering of the 5th argument register, but instead caused syscalls
> made with a 5th argument of -1 to be misinterpreted as a request by
> do_syscall_trace_enter to suppress the syscall.
> 
> Fixes: 0bb605c2c7f2b4b3 ("sh: Add SECCOMP_FILTER")
> Fixes: ab99c733ae73cce3 ("sh: Make syscall tracer use tracehook notifiers, add TIF_NOTIFY_RESUME.")
> Signed-off-by: Rich Felker <dalias@libc.org>

I'm testing this patch now with a rebased kernel and a rebased libseccomp with my
patch for SuperH support on top.

I'll report back later.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2020-09-03  8:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03  5:48 [PATCH] sh: fix syscall tracing Rich Felker
2020-09-03  8:13 ` John Paul Adrian Glaubitz [this message]
2020-09-03 10:14 ` John Paul Adrian Glaubitz
2020-09-03 16:16   ` Rich Felker
2020-09-07  9:52     ` John Paul Adrian Glaubitz
2020-09-07 17:44       ` Rich Felker
2020-09-10  9:55         ` John Paul Adrian Glaubitz
2020-09-10 10:54           ` Rob Landley
2020-09-10 13:37             ` Rich Felker
2020-09-15 10:35               ` John Paul Adrian Glaubitz
2020-09-16  0:28                 ` Rich Felker
2020-09-18 19:29                   ` Rich Felker

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=65bf8a3b-8213-0a67-1156-043bca545ada@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=dalias@libc.org \
    --cc=kernel@mkarcher.dialup.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /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;
as well as URLs for NNTP newsgroup(s).