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, 22 Sep 2022 10:00:20 +0200
From:   Kumar Kartikeya Dwivedi <memxor@...il.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     Lorenzo Bianconi <lorenzo@...nel.org>, bpf <bpf@...r.kernel.org>,
        Network Development <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Florian Westphal <fw@...len.de>,
        netfilter-devel <netfilter-devel@...r.kernel.org>,
        Lorenzo Bianconi <lorenzo.bianconi@...hat.com>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Toke Høiland-Jørgensen <toke@...hat.com>
Subject: Re: [PATCH v3 bpf-next 1/3] bpf: Tweak definition of KF_TRUSTED_ARGS

On Thu, 22 Sept 2022 at 04:39, Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Wed, Sep 21, 2022 at 9:49 AM Lorenzo Bianconi <lorenzo@...nel.org> wrote:
> >
> > +               /* These register types have special constraints wrt ref_obj_id
> > +                * and offset checks. The rest of trusted args don't.
> > +                */
> > +               obj_ptr = reg->type == PTR_TO_CTX || reg->type == PTR_TO_BTF_ID ||
> > +                         reg2btf_ids[base_type(reg->type)];
> > +
>
> ..
>
> >                 /* Check if argument must be a referenced pointer, args + i has
> >                  * been verified to be a pointer (after skipping modifiers).
> > +                * PTR_TO_CTX is ok without having non-zero ref_obj_id.
> >                  */
>
> Kumar,
>
> Looking forward to your subsequent patch to split this function.
> It's definitely getting unwieldy.
>
> The comment above is double confusing.
> 1. I think you meant to say "PTR_TO_CTX is ok with zero ref_obj_id",
> right? That double negate is not easy to parse.
>

Yes.

> 2.
> PTR_TO_CTX cannot have ref_obj_id != 0.
> At least I don't think it's possible, but the comment implies
> that such a case may exist.
>

Yes, but we are checking for that later, which is why we skip it for PTR_TO_CTX.

> I applied anyway, since big refactoring is coming shortly, right?

Yes, which is why I tacked it on like this for now. I will be
reposting later this week.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ