Repository navigation
Commit cddcc99
tcp: do not release socket ownership in tcp_close()
commit 8873c06 upstream.
syzkaller was able to hit the WARN_ON(sock_owned_by_user(sk));
in tcp_close()
While a socket is being closed, it is very possible other
threads find it in rtnetlink dump.
tcp_get_info() will acquire the socket lock for a short amount
of time (slow = lock_sock_fast(sk)/unlock_sock_fast(sk, slow);),
enough to trigger the warning.
Fixes: 67db3e4 ("tcp: no longer hold ehash lock while calling tcp_get_info()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 5999609 commit cddcc99
3 files changed
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1491 | 1491 | | |
1492 | 1492 | | |
1493 | 1493 | | |
| 1494 | + | |
1494 | 1495 | | |
1495 | 1496 | | |
1496 | 1497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2317 | 2317 | | |
2318 | 2318 | | |
2319 | 2319 | | |
2320 | | - | |
| 2320 | + | |
2321 | 2321 | | |
2322 | 2322 | | |
2323 | 2323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2403 | 2403 | | |
2404 | 2404 | | |
2405 | 2405 | | |
2406 | | - | |
2407 | | - | |
2408 | | - | |
2409 | | - | |
2410 | | - | |
2411 | | - | |
2412 | | - | |
2413 | 2406 | | |
2414 | 2407 | | |
2415 | | - | |
| 2408 | + | |
| 2409 | + | |
2416 | 2410 | | |
2417 | 2411 | | |
2418 | 2412 | | |
| |||
2481 | 2475 | | |
2482 | 2476 | | |
2483 | 2477 | | |
| 2478 | + | |
2484 | 2479 | | |
2485 | 2480 | | |
2486 | 2481 | | |
| |||
0 commit comments