lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQ+EzgMEXAN9oJ8asRj_WYOZh2VQOKDJz8mhkqehr7f=3g@mail.gmail.com>
Date: Mon, 5 Jan 2026 20:20:54 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Menglong Dong <menglong.dong@...ux.dev>
Cc: Menglong Dong <menglong8.dong@...il.com>, Andrii Nakryiko <andrii.nakryiko@...il.com>, 
	Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>, 
	Daniel Borkmann <daniel@...earbox.net>, Martin KaFai Lau <martin.lau@...ux.dev>, Eduard <eddyz87@...il.com>, 
	Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>, 
	John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>, 
	Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>, 
	"David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>, 
	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, jiang.biao@...ux.dev, 
	Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, X86 ML <x86@...nel.org>, 
	"H. Peter Anvin" <hpa@...or.com>, bpf <bpf@...r.kernel.org>, 
	Network Development <netdev@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next v6 00/10] bpf: fsession support

On Mon, Jan 5, 2026 at 7:05 PM Menglong Dong <menglong.dong@...ux.dev> wrote:
>
> On 2026/1/6 05:20 Andrii Nakryiko <andrii.nakryiko@...il.com> write:
> > On Sun, Jan 4, 2026 at 4:28 AM Menglong Dong <menglong8.dong@...il.com> wrote:
> > >
> > > Hi, all.
> > >
> [......]
> > > Maybe it's possible to reuse the existing bpf_session_cookie() and
> > > bpf_session_is_return(). First, we move the nr_regs from stack to struct
> > > bpf_tramp_run_ctx, as Andrii suggested before. Then, we define the session
> > > cookies as flexible array in bpf_tramp_run_ctx like this:
> > >     struct bpf_tramp_run_ctx {
> > >         struct bpf_run_ctx run_ctx;
> > >         u64 bpf_cookie;
> > >         struct bpf_run_ctx *saved_run_ctx;
> > >         u64 func_meta; /* nr_args, cookie_index, etc */
> > >         u64 fsession_cookies[];
> > >     };
> > >
> > > The problem of this approach is that we can't inlined the bpf helper
> > > anymore, such as get_func_arg, get_func_ret, get_func_arg_cnt, etc, as
> > > we can't use the "current" in BPF assembly.
> > >
> >
> > We can, as Alexei suggested on your other patch set. Is this still a
> > valid concern?
>
> Yeah, with the support of BPF_MOV64_PERCPU_REG, it's much easier
> now.
>
> So what approach should I use now? Change the prototype of
> bpf_session_is_return/bpf_session_cookie, as Alexei suggested, or
> use the approach here? I think both works, and I'm a little torn
> now. Any suggestions?

I think adding 'void *ctx' to existing kfuncs makes tramp-based
kfuncs faster, since less work needs to be done to store/read
the same data from run_ctx/current.
So that's my preference.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ