[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250117102307.cf919a0e7e59e3df0ddbcd3c@kernel.org>
Date: Fri, 17 Jan 2025 10:23:07 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Jiri Olsa <olsajiri@...il.com>
Cc: Oleg Nesterov <oleg@...hat.com>, Masami Hiramatsu <mhiramat@...nel.org>,
Aleksa Sarai <cyphar@...har.com>, Eyal Birger <eyal.birger@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-trace-kernel@...r.kernel.org, BPF-dev-list <bpf@...r.kernel.org>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>, John
Fastabend <john.fastabend@...il.com>, peterz@...radead.org,
tglx@...utronix.de, bp@...en8.de, x86@...nel.org,
linux-api@...r.kernel.org, Andrii Nakryiko <andrii@...nel.org>, Daniel
Borkmann <daniel@...earbox.net>, Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii.nakryiko@...il.com>, "rostedt@...dmis.org"
<rostedt@...dmis.org>, rafi@....io, Shmulik Ladkani
<shmulik.ladkani@...il.com>
Subject: Re: Crash when attaching uretprobes to processes running in Docker
On Tue, 14 Jan 2025 15:21:29 +0100
Jiri Olsa <olsajiri@...il.com> wrote:
> On Tue, Jan 14, 2025 at 12:21:07PM +0100, Oleg Nesterov wrote:
> > On 01/14, Masami Hiramatsu wrote:
> > >
> > > On Tue, 14 Jan 2025 10:22:20 +0100
> > > Jiri Olsa <olsajiri@...il.com> wrote:
> > >
> > > > @@ -418,6 +439,9 @@ SYSCALL_DEFINE0(uretprobe)
> > > > regs->r11 = regs->flags;
> > > > regs->cx = regs->ip;
> > > >
> > > > + /* zero rbx to signal trampoline that uretprobe syscall was executed */
> > > > + regs->bx = 0;
> > >
> > > Can we just return -ENOSYS as like as other syscall instead of
> > > using rbx as a side channel?
> > > We can carefully check the return address is not -ERRNO when set up
> > > and reserve the -ENOSYS for this use case.
> >
> > Not sure I understand...
> >
> > But please not that the uretprobed function can return any value
> > including -ENOSYS, and this is what sys_uretprobe() has to return.
>
> right, uretprobe syscall returns value of the uretprobed function,
> so we can't use any reserved value
We can make uretprobe (entry) fail if the return value is one of
errno or NULL, because it *knows* what the return value here.
Thank you,
>
> jirka
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists