From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Cc: Oleg Nesterov <oleg@redhat.com>, James Hogan <jhogan@kernel.org>,
Kees Cook <kees@kernel.org>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH] MIPS: ptrace: Fix syscall skipping via PTRACE_SYSCALL
Date: Tue, 21 Jul 2026 17:04:34 +0200 [thread overview]
Message-ID: <al-KglT33I2jzUC7@alpha.franken.de> (raw)
In-Reply-To: <27072da0-124d-4a87-b037-f56320c8e97b@oss.qualcomm.com>
On Tue, Jul 21, 2026 at 04:43:40PM +0200, Philippe Mathieu-Daudé wrote:
> Hi Thomas,
>
> +Jiaxun
>
> On 17/7/26 13:27, Thomas Bogendoerfer wrote:
> > If tracer wanted to skip a syscall return value was always
> > overwritten with -ENOSYS. Fix this by checking against original
> > syscall number and only return -ENOSYS, if it is negative.
> >
> > Fixes: b6318a903d06 ("MIPS/ptrace: Pick up ptrace/seccomp changed syscalls")
>
> I think you meant:
>
> Fixes: 4370b673ccf2 ("MIPS: scall: Save thread_info.syscall unconditionally
> on entry")
no it was already broken before that commit.
b6318a903d06 reloads syscall number after tracehook_report_syscall_entry() so
the check for negative syscall is done with the "manipulated" syscall number.
And it the syscall should be skipped that number is -1.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2026-07-21 15:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 11:27 [PATCH] MIPS: ptrace: Fix syscall skipping via PTRACE_SYSCALL Thomas Bogendoerfer
2026-07-18 15:23 ` Oleg Nesterov
2026-07-21 14:43 ` Philippe Mathieu-Daudé
2026-07-21 15:04 ` Thomas Bogendoerfer [this message]
2026-08-03 13:15 ` Thomas Bogendoerfer
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=al-KglT33I2jzUC7@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=jhogan@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=philmd@oss.qualcomm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.