]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: fix incorrect msg_zerocopy copy notifications
authorWillem de Bruijn <willemb@google.com>
Wed, 9 Jun 2021 22:41:57 +0000 (18:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jun 2021 20:39:57 +0000 (13:39 -0700)
commitfcc685cb2026b38c5021db45456fb5175fe344bf
tree7570089040ba20cd29843991e4bdd5c35a0812b9
parent3475faced8e27137a188cd793ec73d6644674f9a
skbuff: fix incorrect msg_zerocopy copy notifications

msg_zerocopy signals if a send operation required copying with a flag
in serr->ee.ee_code.

This field can be incorrect as of the below commit, as a result of
both structs uarg and serr pointing into the same skb->cb[].

uarg->zerocopy must be read before skb->cb[] is reinitialized to hold
serr. Similar to other fields len, hi and lo, use a local variable to
temporarily hold the value.

This was not a problem before, when the value was passed as a function
argument.

Fixes: 04fe7b108d9b ("skbuff: Push status and refcounts into sock_zerocopy_callback")
Reported-by: Talal Ahmad <talalahmad@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c