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]
Message-ID: <CAOftzPjHhcFpadsBz6qGwx3hcmj2Xe2fs0HN-jBM+-Eh5OgZvg@mail.gmail.com>
Date:   Fri, 27 Mar 2020 10:38:41 -0700
From:   Joe Stringer <joe@...d.net.nz>
To:     Jamal Hadi Salim <jhs@...atatu.com>
Cc:     Joe Stringer <joe@...d.net.nz>, bpf <bpf@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Lorenz Bauer <lmb@...udflare.com>,
        Martin KaFai Lau <kafai@...com>
Subject: Re: [PATCHv3 bpf-next 3/5] bpf: Don't refcount LISTEN sockets in sk_assign()

On Fri, Mar 27, 2020 at 7:26 AM Jamal Hadi Salim <jhs@...atatu.com> wrote:
>
> On 2020-03-27 12:25 a.m., Joe Stringer wrote:
> > BPF_CALL_1(bpf_sk_release, struct sock *, sk)
> >   {
> > -     /* Only full sockets have sk->sk_flags. */
> > -     if (!sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE))
> > +     if (sk_is_refcounted(sk))
> >               sock_gen_put(sk);
> >       return 0;
> >   }
>
>
> Would it make sense to have both the bpf_sk_release and bpf_sk_assign()
> centralized so we dont replicate the functionality in tc? Reduces
> maintainance overhead.

I think sock_pfree() steps in that direction, we would just need the
corresponding refactoring for sk_assign bits. Sounds like a good idea.

This shouldn't functionally affect this series, I'm happy to either
spin this into next revision of this series (if there's other
feedback), or send a followup refactor for this, or defer this to your
TC follow-up series that would consume the refactored functions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ