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] [day] [month] [year] [list]
Date:   Mon, 16 Nov 2020 14:28:39 -0800
From:   John Fastabend <john.fastabend@...il.com>
To:     Jakub Sitnicki <jakub@...udflare.com>,
        John Fastabend <john.fastabend@...il.com>
Cc:     ast@...nel.org, daniel@...earbox.net, bpf@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [bpf PATCH v2 5/6] bpf, sockmap: Handle memory acct if
 skb_verdict prog redirects to self

Jakub Sitnicki wrote:
> On Fri, Nov 13, 2020 at 12:27 AM CET, John Fastabend wrote:
> > If the skb_verdict_prog redirects an skb knowingly to itself, fix your
> > BPF program this is not optimal and an abuse of the API please use
> > SK_PASS. That said there may be cases, such as socket load balancing,
> > where picking the socket is hashed based or otherwise picks the same
> > socket it was received on in some rare cases. If this happens we don't
> > want to confuse userspace giving them an EAGAIN error if we can avoid
> > it.

[...]
 
> 
> I think all the added checks boil down to having:
> 
> 	struct sock *sk = psock->sk;
> 
>         if (unlikely(skb->sk == sk))
>                 return sk_psock_skb_ingress_self(psock, skb);
> 
> ... on entry to sk_psock_skb_ingress().

Agree made the change and sent out v3 thanks. I also carried your
Reviewed-by through on patches 1-4 and 6.

Thanks for reviewing!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ