net: add missing skb_uarg refcount increment in pskb_carve_inside_header()
Subsystems (2)
Quoted 5 lines · Willem de Bruijn
Quoted 3 lines · Miaohe Lin
If the skb is zcopied, we should increase the
skb_uargrefcount before we involveskb_release_data(). Seepskb_expand_head()as a reference.
Quoted 9 lines
Did you manage to observe a bug through this datapath in practice?
pskb_carve_inside_headeris called
frompskb_carve
frompskb_extract
fromrds_tcp_data_recvThat 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. 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.
Thanks.
Quoted 2 lines
Quoted 2 lines
Fixes 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")Signed-off-by Miaohe Lin <[email protected]>
Quoted 14 lines · linmiaohe
Quoted 12 lines · Willem de Bruijn
Quoted 3 lines · Miaohe Lin
If the skb is zcopied, we should increase the
skb_uargrefcount before we involveskb_release_data(). Seepskb_expand_head()as a reference.Did you manage to observe a bug through this datapath in practice?
pskb_carve_inside_headeris called
frompskb_carve
frompskb_extract
fromrds_tcp_data_recv
Quoted 4 lines
Quoted 2 lines
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_uargrefcount for future use.
If a new application of this interface is proposed, the author will have to make sure that it is exercised correctly.
Quoted 2 lines
On the other hand, because this codepath should not see any packets with zerocopy state associated, then we should not call
skb_orphan_fragshere.
I'm also not convinced that the skb_orphan_frags here are needed, given the only path is from tcp_read_sock.