Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1592187 > unrolled thread
| Started by | Eric Dumazet <edumazet@google.com> |
|---|---|
| First post | 2017-03-03 19:30 +0100 |
| Last post | 2017-03-03 22:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: net/ipv4: division by 0 in tcp_select_window Eric Dumazet <edumazet@google.com> - 2017-03-03 19:30 +0100
Re: net/ipv4: division by 0 in tcp_select_window Eric Dumazet <eric.dumazet@gmail.com> - 2017-03-03 22:30 +0100
| From | Eric Dumazet <edumazet@google.com> |
|---|---|
| Date | 2017-03-03 19:30 +0100 |
| Subject | Re: net/ipv4: division by 0 in tcp_select_window |
| Message-ID | <th07L-556-5@gated-at.bofh.it> |
On Fri, Mar 3, 2017 at 10:10 AM, Dmitry Vyukov <dvyukov@google.com> wrote: > Hello, > > The following program triggers division by 0 in tcp_select_window: > > https://gist.githubusercontent.com/dvyukov/ef28c0fd2ab57a655508ef7621b12e6c/raw/079011e2a9523a390b0621cbc1e5d9d5e637fd6d/gistfile1.txt Yeah, tcp_disconnect() should never have existed in the first place. We'll send a patch, unless you take care of this before us . Thanks.
[toc] | [next] | [standalone]
| From | Eric Dumazet <eric.dumazet@gmail.com> |
|---|---|
| Date | 2017-03-03 22:30 +0100 |
| Message-ID | <th2VX-70F-5@gated-at.bofh.it> |
| In reply to | #1592187 |
On Fri, 2017-03-03 at 10:25 -0800, Eric Dumazet wrote:
> On Fri, Mar 3, 2017 at 10:10 AM, Dmitry Vyukov <dvyukov@google.com> wrote:
> > Hello,
> >
> > The following program triggers division by 0 in tcp_select_window:
> >
> > https://gist.githubusercontent.com/dvyukov/ef28c0fd2ab57a655508ef7621b12e6c/raw/079011e2a9523a390b0621cbc1e5d9d5e637fd6d/gistfile1.txt
>
> Yeah, tcp_disconnect() should never have existed in the first place.
>
> We'll send a patch, unless you take care of this before us .
Could you try this first patch ?
Probably others will also be needed.
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 40d893556e6701ace6a02903e53c45822d6fa56d..2187ebf1f270d19e6dd019b8f9df5eef8d018e03 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -552,7 +552,8 @@ void tcp_write_timer_handler(struct sock *sk)
struct inet_connection_sock *icsk = inet_csk(sk);
int event;
- if (sk->sk_state == TCP_CLOSE || !icsk->icsk_pending)
+ if (((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) ||
+ !icsk->icsk_pending)
goto out;
if (time_after(icsk->icsk_timeout, jiffies)) {
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web