Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sk_buff: avoid potentially clearing 'slow_gro' field

If skb_dst_set_noref() is invoked with a NULL dst, the 'slow_gro'
field is cleared, too. That could lead to wrong behavior if
the skb later enters the GRO stage.

Fix the potential issue replacing preserving a non-zero value of
the 'slow_gro' field.

Additionally, fix a comment typo.

Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Reported-by: Jakub Kicinski <kuba@kernel.org>
Fixes: 8a886b142bd0 ("sk_buff: track dst status in slow_gro")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/aa42529252dc8bb02bd42e8629427040d1058537.1627662501.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Paolo Abeni and committed by
Jakub Kicinski
a432934a bc830525

+2 -2
+1 -1
include/linux/skbuff.h
··· 1009 1009 static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst) 1010 1010 { 1011 1011 WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held()); 1012 - skb->slow_gro = !!dst; 1012 + skb->slow_gro |= !!dst; 1013 1013 skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF; 1014 1014 } 1015 1015
+1 -1
net/core/dev.c
··· 6022 6022 skb_mac_header(skb), 6023 6023 maclen); 6024 6024 6025 - /* in most common scenarions _state is 0 6025 + /* in most common scenarions 'slow_gro' is 0 6026 6026 * otherwise we are already on some slower paths 6027 6027 * either skip all the infrequent tests altogether or 6028 6028 * avoid trying too hard to skip each of them individually