Re: [PATCHv2 1/3] uprobe: Add uretprobe syscall to speed up return probe

From
Oleg Nesterov <oleg@redhat.com>
Date
2024-04-06 17:57:38
Also in
bpf, linux-trace-kernel, lkml
Reply to
Masami Hiramatsu (Google), 2024-04-06
On 04/06, Masami Hiramatsu wrote:
On Fri, 5 Apr 2024 13:02:30 +0200
Oleg Nesterov [off-list ref] wrote:
quoted
With or without this patch userpace can also do

	foo() { <-- retprobe1
		bar() {
			jump to xol_area
		}
	}

handle_trampoline() will handle retprobe1.
This is OK because the execution path has been changed to trampoline,
Agreed, in this case the misuse is more clear. But please see below.
but the above will continue running bar() after sys_uretprobe().
... and most probably crash
quoted
sigreturn() can be "improved" too. Say, it could validate sigcontext->ip
and return -EINVAL if this addr is not valid. But why?
Because sigreturn() never returns, but sys_uretprobe() will return.
You mean, sys_uretprobe() returns to the next insn after syscall.

Almost certainly yes, but this is not necessarily true. If one of consumers
changes regs->sp sys_uretprobe() "returns" to another location, just like
sys_rt_sigreturn().

That said.

Masami, it is not that I am trying to prove that you are "wrong" ;) No.

I see your points even if I am biased, I understand that my objections are
not 100% "fair".

I am just trying to explain why, rightly or not, I care much less about the
abuse of sys_uretprobe().

Thanks!

Oleg.
Thread (14 messages) 14 messages, 3 authors, last reply 2024-04-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help