Commit 60a2c80
af_unix: Annotate data-race of sk->sk_state in unix_stream_connect().
[ Upstream commit a9bf9c7 ]
As small optimisation, unix_stream_connect() prefetches the client's
sk->sk_state without unix_state_lock() and checks if it's TCP_CLOSE.
Later, sk->sk_state is checked again under unix_state_lock().
Let's use READ_ONCE() for the first check and TCP_CLOSE directly for
the second check.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent c4cc9b5 commit 60a2c80
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
1472 | | - | |
1473 | 1472 | | |
1474 | 1473 | | |
1475 | 1474 | | |
| |||
1553 | 1552 | | |
1554 | 1553 | | |
1555 | 1554 | | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
| 1555 | + | |
1559 | 1556 | | |
1560 | 1557 | | |
1561 | 1558 | | |
| |||
1570 | 1567 | | |
1571 | 1568 | | |
1572 | 1569 | | |
1573 | | - | |
| 1570 | + | |
1574 | 1571 | | |
1575 | 1572 | | |
1576 | 1573 | | |
| |||
0 commit comments