Commit a9bf9c7
af_unix: Annotate data-race of sk->sk_state in unix_stream_connect().
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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent eb0718f commit a9bf9c7
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1481 | 1481 | | |
1482 | 1482 | | |
1483 | 1483 | | |
1484 | | - | |
1485 | 1484 | | |
1486 | 1485 | | |
1487 | 1486 | | |
| |||
1571 | 1570 | | |
1572 | 1571 | | |
1573 | 1572 | | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
| 1573 | + | |
1577 | 1574 | | |
1578 | 1575 | | |
1579 | 1576 | | |
| |||
1588 | 1585 | | |
1589 | 1586 | | |
1590 | 1587 | | |
1591 | | - | |
| 1588 | + | |
1592 | 1589 | | |
1593 | 1590 | | |
1594 | 1591 | | |
| |||
0 commit comments