: tcp: Fix queue traversal in tcp_use_frto().
Subsystems (3)
David Miller
maintainerPATCH 1/1 : tcp: Fix queue traversal in tcp_use_frto().
One more skb_queue_next() BUG trigger. I double audited the remaining tcp_write_queue_next() cases and they should all be good.
tcp: Fix queue traversal in tcp_use_frto().
We must check tcp_skb_is_last() before doing a tcp_write_queue_next().
--- net/ipv4/tcp_input.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
net/ipv4/tcp_input.c +2 -0
@@ -1746,6 +1746,8 @@ int tcp_use_frto(struct sock *sk)return 0 ; skb =tcp_write_queue_head (sk); +if (tcp_skb_is_last (sk, skb)) +return 1 ; skb =tcp_write_queue_next (sk, skb);/* Skips head */ tcp_for_write_queue_from(skb, sk) {if (skb ==tcp_send_head (sk))
Signature · 1 line
1.5.6.5
Quoted 20 lines · David Miller
One more
skb_queue_next()BUG trigger. I double audited the remainingtcp_write_queue_next()cases and they should all be good.tcp: Fix queue traversal in
tcp_use_frto().We must check
tcp_skb_is_last()before doing atcp_write_queue_next().Signed-off-by David S. Miller <[email protected]>--- net/ipv4/tcp_input.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)net/ipv4/tcp_input.c +0
-0
net/ipv4/tcp_input.c int tcp_use_frto(struct sock *sk) · line 1753
Quoted 8 lines
net/ipv4/tcp_input.c +2
-0@@ -1746,6 +1746,8 @@ int tcp_use_frto(struct sock *sk)return 0 ; skb =tcp_write_queue_head (sk); +if (tcp_skb_is_last (sk, skb)) +return 1 ; skb =tcp_write_queue_next (sk, skb);/* Skips head */ tcp_for_write_queue_from(skb, sk) {if (skb ==tcp_send_head (sk))
For the record (as you probably know it already), this wasn't actually a real bug though it hits your BUG_ON since tcp_for_write_queue_from exits immediately, no garbage gets dereferenced.
Signature · 1 line
i.
David Miller
maintainerFrom: "Ilpo Järvinen" <[email protected]>
Date: Tue, 23 Sep 2008 22:18:33 +0300 (EEST)
Quoted 3 lines
For the record (as you probably know it already), this wasn't actually a real bug though it hits your
BUG_ONsincetcp_for_write_queue_fromexits immediately, no garbage gets dereferenced.
Yes, that is correct.
It is actually disappointing for me, I thought maybe it would catch a real bug somewhere :-)
Quoted 11 lines · David Miller
From: "Ilpo Järvinen" <[email protected]>
Date: Tue, 23 Sep 2008 22:18:33 +0300 (EEST)Quoted 3 lines
For the record (as you probably know it already), this wasn't actually a real bug though it hits your
BUG_ONsincetcp_for_write_queue_fromexits immediately, no garbage gets dereferenced.Yes, that is correct.
It is actually disappointing for me, I thought maybe it would catch a real bug somewhere :-)
Rest assured, it will definately do that once some rewrite or so happens... :-)
Signature · 1 line
i.