lkml.org 
[lkml]   [2020]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] net: add missing skb_uarg refcount increment in pskb_carve_inside_header()
On Fri, Aug 14, 2020 at 9:20 AM linmiaohe <linmiaohe@huawei.com> wrote:
>
> Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
> >On Thu, Aug 13, 2020 at 2:16 PM Miaohe Lin <linmiaohe@huawei.com> wrote:
> >>
> >> If the skb is zcopied, we should increase the skb_uarg refcount before
> >> we involve skb_release_data(). See pskb_expand_head() as a reference.
> >
> >Did you manage to observe a bug through this datapath in practice?
> >
> >pskb_carve_inside_header is called
> > from pskb_carve
> > from pskb_extract
> > from rds_tcp_data_recv
> >
> >That receive path should not see any packets with zerocopy state associated.
> >
>
> This works fine yet as its caller is limited. But we should take care of the skb_uarg refcount for future use.

If a new application of this interface is proposed, the author will
have to make sure that it is exercised correctly.

> On the other hand, because this codepath should not see any packets with zerocopy state associated, then we
> should not call skb_orphan_frags here.

I'm also not convinced that the skb_orphan_frags here are needed,
given the only path is from tcp_read_sock.

\
 
 \ /
  Last update: 2020-08-14 15:47    [W:0.036 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site