Commit c4cc9b5
af_unix: Annotate data-races around sk->sk_state in unix_write_space() and poll().
[ Upstream commit eb0718f ]
unix_poll() and unix_dgram_poll() read sk->sk_state locklessly and
calls unix_writable() which also reads sk->sk_state without holding
unix_state_lock().
Let's use READ_ONCE() in unix_poll() and unix_dgram_poll() and pass
it to unix_writable().
While at it, we remove TCP_SYN_SENT check in unix_dgram_poll() as
that state does not exist for AF_UNIX socket since the code was added.
Fixes: 1586a58 ("af_unix: do not report POLLOUT on listeners")
Fixes: 3c73419 ("af_unix: fix 'poll for write'/ connected DGRAM sockets")
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 8f4b123 commit c4cc9b5
1 file changed
+12
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | | - | |
| 523 | + | |
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
| 532 | + | |
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| |||
3180 | 3180 | | |
3181 | 3181 | | |
3182 | 3182 | | |
| 3183 | + | |
3183 | 3184 | | |
3184 | 3185 | | |
3185 | 3186 | | |
3186 | 3187 | | |
3187 | 3188 | | |
3188 | 3189 | | |
| 3190 | + | |
3189 | 3191 | | |
3190 | 3192 | | |
3191 | 3193 | | |
| |||
3207 | 3209 | | |
3208 | 3210 | | |
3209 | 3211 | | |
3210 | | - | |
| 3212 | + | |
3211 | 3213 | | |
3212 | 3214 | | |
3213 | 3215 | | |
3214 | 3216 | | |
3215 | 3217 | | |
3216 | 3218 | | |
3217 | | - | |
| 3219 | + | |
3218 | 3220 | | |
3219 | 3221 | | |
3220 | 3222 | | |
| |||
3225 | 3227 | | |
3226 | 3228 | | |
3227 | 3229 | | |
| 3230 | + | |
3228 | 3231 | | |
3229 | 3232 | | |
3230 | 3233 | | |
3231 | 3234 | | |
3232 | 3235 | | |
3233 | 3236 | | |
| 3237 | + | |
3234 | 3238 | | |
3235 | 3239 | | |
3236 | 3240 | | |
| |||
3249 | 3253 | | |
3250 | 3254 | | |
3251 | 3255 | | |
3252 | | - | |
3253 | | - | |
3254 | | - | |
3255 | | - | |
3256 | | - | |
3257 | | - | |
3258 | | - | |
| 3256 | + | |
| 3257 | + | |
3259 | 3258 | | |
3260 | 3259 | | |
3261 | 3260 | | |
3262 | 3261 | | |
3263 | 3262 | | |
3264 | | - | |
| 3263 | + | |
3265 | 3264 | | |
3266 | 3265 | | |
3267 | 3266 | | |
| |||
0 commit comments