Subject: Re: [PATCH net-next] bpf: restore skb->sk before pskb_trim() call

From: Daniel Borkmann <[email-masked]>
Date: Wed, 26 Apr 2017 18:14:51 +0200

On 04/26/2017 06:09 PM, Eric Dumazet wrote:
> From: Eric Dumazet <[email-masked]>
>
> While testing a fix [1] in ___pskb_trim(), addressing the WARN_ON_ONCE()
> in skb_try_coalesce() reported by Andrey, I found that we had an skb
> with skb->sk set but no skb->destructor.
>
> This invalidated heuristic found in commit 158f323b9868 ("net: adjust
> skb->truesize in pskb_expand_head()") and in cited patch.
>
> Considering the BUG_ON(skb->sk) we have in skb_orphan(), we should
> restrain the temporary setting to a minimal section.
>
> [1] https://patchwork.ozlabs.org/patch/755570/
>      net: adjust skb->truesize in ___pskb_trim()
>
> Fixes: 8f917bba0042 ("bpf: pass sk to helper functions")
> Signed-off-by: Eric Dumazet <[email-masked]>
> Cc: Willem de Bruijn <[email-masked]>
> Cc: Andrey Konovalov <[email-masked]>

Good point, thanks!

Acked-by: Daniel Borkmann <[email-masked]>