Skip to contentSkip to conversation

tcp: remove BUG_ON in tcp_shifted_skb

RFC In review Li,Rongqing 2 participants 2 messages Jan 17, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 tcp: remove BUG_ON in tcp_shifted_skb

I think this BUG_ON in tcp_shifted_skb maybe be triggered if a GSO skb is sacked, but sack is faked, and not ack the whole mss length, only ack less than mss length

Is it possible ?

- Li RongQing <[email protected]>

---
 net/ipv4/tcp_input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/tcp_input.c +0 -1
index 1d1e3493965f..141bc85092b5 100644
@@ -1327,7 +1327,8 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
        TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
 
        if (skb->len > 0) {
-               BUG_ON(!tcp_skb_pcount(skb));
                NET_INC_STATS(sock_net(sk), LINUX_MIB_SACKSHIFTED);
                return false;
        }
Signature · 1 line
2.16.2
#1 lore raw
Quoted 6 lines · Li,Rongqing

I think this BUG_ON in tcp_shifted_skb maybe be triggered if a GSO skb is sacked, but sack is faked, and not ack the whole mss length, only ack less than mss length

Is it possible ?

I doubt it. Please provide a packetdrill test if you think otherwise.

Quoted 12 lines

- Li RongQing <[email protected]>

---
 net/ipv4/tcp_input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/tcp_input.c +0 -0
index 1d1e3493965f..141bc85092b5 100644

net/ipv4/tcp_input.c static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev, · line 1330

Quoted 4 lines
net/ipv4/tcp_input.c +0 -1
@@ -1327,7 +1327,8 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
        TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
 
        if (skb->len > 0) {
-               BUG_ON(!tcp_skb_pcount(skb));

I understand people can be worried about BUG_ON(), but they serve to spot bugs when a patch breaks something horribly.