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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 14 Sep 2023 18:53:11 +0200
From:   Larysa Zaremba <larysa.zaremba@...el.com>
To:     Maciej Fijalkowski <maciej.fijalkowski@...el.com>
CC:     <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
        "Daniel Borkmann" <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        "Martin KaFai Lau" <martin.lau@...ux.dev>,
        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@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next] bpf: Allow to use kfunc XDP hints and frags
 together

On Thu, Sep 14, 2023 at 06:38:15PM +0200, Maciej Fijalkowski wrote:
> On Thu, Sep 14, 2023 at 10:37:11AM +0200, Larysa Zaremba wrote:
> > There is no fundamental reason, why multi-buffer XDP and XDP kfunc RX hints
> > cannot coexist in a single program.
> > 
> > Allow those features to be used together by modifying the flags conditions.
> > 
> > Suggested-by: Stanislav Fomichev <sdf@...gle.com>
> > Link: https://lore.kernel.org/bpf/CAKH8qBuzgtJj=OKMdsxEkyML36VsAuZpcrsXcyqjdKXSJCBq=Q@mail.gmail.com/
> > Signed-off-by: Larysa Zaremba <larysa.zaremba@...el.com>
> 
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
> 
> Though it would be worth spelling out something in the commit msg about
> additional check you're adding (frags flag can't go without dev bound)
>

Ok, I'll add to the commit message the below:

Frags are allowed only if program is dev-bound-only, but not if it is requesting 
bpf offload.

> > ---
> >  kernel/bpf/offload.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
> > index ee35f33a96d1..43aded96c79b 100644
> > --- a/kernel/bpf/offload.c
> > +++ b/kernel/bpf/offload.c
> > @@ -232,7 +232,11 @@ int bpf_prog_dev_bound_init(struct bpf_prog *prog, union bpf_attr *attr)
> >  	    attr->prog_type != BPF_PROG_TYPE_XDP)
> >  		return -EINVAL;
> >  
> > -	if (attr->prog_flags & ~BPF_F_XDP_DEV_BOUND_ONLY)
> > +	if (attr->prog_flags & ~(BPF_F_XDP_DEV_BOUND_ONLY | BPF_F_XDP_HAS_FRAGS))
> > +		return -EINVAL;
> > +
> > +	if (attr->prog_flags & BPF_F_XDP_HAS_FRAGS &&
> > +	    !(attr->prog_flags & BPF_F_XDP_DEV_BOUND_ONLY))
> >  		return -EINVAL;
> >  
> >  	if (attr->prog_type == BPF_PROG_TYPE_SCHED_CLS &&
> > -- 
> > 2.41.0
> > 
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ