[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZkxzbSq3bS2loTJI@krava>
Date: Tue, 21 May 2024 12:11:57 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
Cc: "olsajiri@...il.com" <olsajiri@...il.com>,
"oleg@...hat.com" <oleg@...hat.com>,
"songliubraving@...com" <songliubraving@...com>,
"luto@...nel.org" <luto@...nel.org>,
"mhiramat@...nel.org" <mhiramat@...nel.org>,
"andrii@...nel.org" <andrii@...nel.org>,
"debug@...osinc.com" <debug@...osinc.com>,
"john.fastabend@...il.com" <john.fastabend@...il.com>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"ast@...nel.org" <ast@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-man@...r.kernel.org" <linux-man@...r.kernel.org>,
"yhs@...com" <yhs@...com>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"peterz@...radead.org" <peterz@...radead.org>,
"linux-trace-kernel@...r.kernel.org" <linux-trace-kernel@...r.kernel.org>,
"bp@...en8.de" <bp@...en8.de>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCHv5 bpf-next 6/8] x86/shstk: Add return uprobe support
On Tue, May 21, 2024 at 01:31:53AM +0000, Edgecombe, Rick P wrote:
> On Mon, 2024-05-20 at 00:18 +0200, Jiri Olsa wrote:
> > anyway I think we can fix that in another way by using the optimized
> > trampoline,
> > but returning to the user space through iret when shadow stack is detected
> > (as I did in the first version, before you adjusted it to the sysret path).
> >
> > we need to update the return address on stack only when returning through the
> > trampoline, but we can jump to original return address directly from syscall
> > through iret.. which is slower, but with shadow stack we don't care
> >
> > basically the only change is adding the shstk_is_enabled check to the
> > following condition in SYSCALL_DEFINE0(uretprobe):
> >
> > if (regs->sp != sp || shstk_is_enabled())
> > return regs->ax;
>
> On the surface it sounds reasonable. Thanks.
>
> And then I guess if tradeoffs are seen differently in the future, and we want to
> enable the fast path for shadow stack we can go with your other solution. So
> this just simply fixes things functionally without much code.
yes, if we want to enable the fast path for shadow stack in future
we'll need to remove that shstk_is_enabled and push extra frame on
shadow stack
jirka
Powered by blists - more mailing lists