[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202501201331.83DB01794@keescook>
Date: Mon, 20 Jan 2025 13:32:26 -0800
From: Kees Cook <kees@...nel.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Eyal Birger <eyal.birger@...il.com>, luto@...capital.net,
wad@...omium.org, ldv@...ace.io, mhiramat@...nel.org,
andrii@...nel.org, jolsa@...nel.org, alexei.starovoitov@...il.com,
olsajiri@...il.com, cyphar@...har.com, songliubraving@...com,
yhs@...com, john.fastabend@...il.com, peterz@...radead.org,
tglx@...utronix.de, bp@...en8.de, daniel@...earbox.net,
ast@...nel.org, andrii.nakryiko@...il.com, rostedt@...dmis.org,
rafi@....io, shmulik.ladkani@...il.com, bpf@...r.kernel.org,
linux-api@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] seccomp: passthrough uretprobe systemcall without
filtering
On Sun, Jan 19, 2025 at 01:40:22PM +0100, Oleg Nesterov wrote:
> On 01/18, Kees Cook wrote:
> >
> > On Thu, Jan 16, 2025 at 04:55:39PM -0800, Eyal Birger wrote:
> > > Since uretprobe is a "kernel implementation detail" system call which is
> > > not used by userspace application code directly, it is impractical and
> > > there's very little point in forcing all userspace applications to
> > > explicitly allow it in order to avoid crashing tracked processes.
> >
> > How is this any different from sigreturn, rt_sigreturn, or
> > restart_syscall? These are all handled explicitly by userspace filters
> > already, and I don't see why uretprobe should be any different.
>
> The only difference is that sys_uretprobe() is new and existing setups
> doesn't know about it. Suppose you have
>
> int func(void)
> {
> return 123;
> }
>
> int main(void)
> {
> seccomp(SECCOMP_SET_MODE_STRICT, 0,0);
> for (;;)
> func();
> }
>
> and it runs with func() uretprobed.
>
> If you install the new kernel, this application will crash immediately.
>
> I understand your objections, but what do you think we can do instead?
> I don't think a new "try_to_speedup_uretprobes_at_your_own_risk" sysctl
> makes sense, it will be almost never enabled...
This seems like a uretprobes design problem. If it's going to use
syscalls, it must take things like seccomp into account.
SECCOMP_SET_MODE_STRICT will also crash in the face of syscall_restart...
--
Kees Cook
Powered by blists - more mailing lists