mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Keke Ming <ming.jvle@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	Linux trace kernel <linux-trace-kernel@vger.kernel.org>,
	"linux-perf-use." <linux-perf-users@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>
Subject: Re: SIGILL and uretprobes, WAS: [PATCH] uprobes: Free utask on dup_return_instance() failure
Date: Wed, 26 Aug 2026 13:49:03 +0200	[thread overview]
Message-ID: <ao7Sr0zqFoiKgaRM@redhat.com> (raw)
In-Reply-To: <CAEf4BzZGQ50=B4S2NBZnqWN29YBgthMX8LsYGLq5rOsdGzpS3w@mail.gmail.com>

On 08/25, Andrii Nakryiko wrote:
>
> On Tue, Aug 25, 2026 at 9:38 AM Andrii Nakryiko
> <andrii.nakryiko@gmail.com> wrote:
> >
> > On Tue, Aug 25, 2026 at 5:27 AM Oleg Nesterov <oleg@redhat.com> wrote:
> > >
> > > On 08/24, Andrii Nakryiko wrote:
> > > >
> > > > On Mon, Aug 24, 2026 at 8:57 AM Oleg Nesterov <oleg@redhat.com> wrote:
> > > > >
> > > > > force_exit_sig(SIGILL) can't be ignored too. But I am fine either way.
> > > >
> > > > Current SIGILL sending is already pretty bad behavior that bites us
> > > > periodically, instead of doubling down on killing the user space
> > > > process because something about installing uprobe goes wrong, let's
> > > > think about a bit less destructive way to do this. Mark uprobe for a
> > > > particular process as defunct or "detaching it", or something along
> > > > those lines. But not just kill innocent processes.
> > >
> > > Well. Yes, SIGILL sending acts as BUG_ON(), this is not nice and
> >
> > The problem is that this is actually not a bug but a very real and
> > expected behavior with user-space using fibers or coroutines. Any
> > suggestions how we can make this less violent, as it's actually quite
> > dangerous and kills production applications when someone (unknowingly)
> > tries to uretprobe trace them...
> >
>
> IIUC, this SIGILL and coroutines/fibers issue is due to
> uprobe_handle_trampoline not finding utrask->return_instances, because
> a bit earlier we threw out pending uretprobes due to
> arch_uretprobe_is_alive() returned false due to that `regs->sp <=
> ret->stack` check (for x86-64).

Well, unless I am totally confused this is another thing...

Yes, arch_uretprobe_is_alive() sucks, it assumes the single stack.

And I do not know how to fix this problem... uprobe_handle_trampoline()
must fix regs->ip correctly somehow, otherwise it is pointless to contunue.

Note also that the current instruction_pointer_set(ri->orig_ret_vaddr)
can be wrong if the probed task switches its stack.

And we have the same problems with sigaltstack().

ATM, I don't see any solution, and I don't really understand what do
you propose...

Oleg.


  reply	other threads:[~2026-08-26 11:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-22  5:46 Keke Ming
2026-08-22 15:09 ` [PATCH v2] " Keke Ming
2026-08-23 15:38 ` [PATCH] " Oleg Nesterov
2026-08-23 16:26   ` Keke Ming
2026-08-23 19:41     ` Oleg Nesterov
2026-08-24 11:22       ` Keke Ming
2026-08-24 15:57         ` Oleg Nesterov
2026-08-24 19:54           ` Andrii Nakryiko
2026-08-25 12:26             ` Oleg Nesterov
2026-08-25 16:38               ` Andrii Nakryiko
2026-08-25 18:23                 ` SIGILL and uretprobes, WAS: " Andrii Nakryiko
2026-08-26 11:49                   ` Oleg Nesterov [this message]
2026-08-27 16:44                     ` Andrii Nakryiko

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=ao7Sr0zqFoiKgaRM@redhat.com \
    --to=oleg@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=ming.jvle@gmail.com \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®