Re: [bpf PATCH v2 5/6] bpf, sockmap: Handle memory acct if skb_verdict prog redirects to self

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux