Commit eb0718f
af_unix: Annotate data-races around sk->sk_state in unix_write_space() and poll().
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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent 3a0f38e commit eb0718f
1 file changed
Lines changed: 12 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | | - | |
| 535 | + | |
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| |||
3129 | 3129 | | |
3130 | 3130 | | |
3131 | 3131 | | |
| 3132 | + | |
3132 | 3133 | | |
3133 | 3134 | | |
3134 | 3135 | | |
3135 | 3136 | | |
3136 | 3137 | | |
3137 | 3138 | | |
| 3139 | + | |
3138 | 3140 | | |
3139 | 3141 | | |
3140 | 3142 | | |
| |||
3156 | 3158 | | |
3157 | 3159 | | |
3158 | 3160 | | |
3159 | | - | |
| 3161 | + | |
3160 | 3162 | | |
3161 | 3163 | | |
3162 | 3164 | | |
3163 | 3165 | | |
3164 | 3166 | | |
3165 | 3167 | | |
3166 | | - | |
| 3168 | + | |
3167 | 3169 | | |
3168 | 3170 | | |
3169 | 3171 | | |
| |||
3174 | 3176 | | |
3175 | 3177 | | |
3176 | 3178 | | |
| 3179 | + | |
3177 | 3180 | | |
3178 | 3181 | | |
3179 | 3182 | | |
3180 | 3183 | | |
3181 | 3184 | | |
3182 | 3185 | | |
| 3186 | + | |
3183 | 3187 | | |
3184 | 3188 | | |
3185 | 3189 | | |
| |||
3199 | 3203 | | |
3200 | 3204 | | |
3201 | 3205 | | |
3202 | | - | |
3203 | | - | |
3204 | | - | |
3205 | | - | |
3206 | | - | |
3207 | | - | |
3208 | | - | |
| 3206 | + | |
| 3207 | + | |
3209 | 3208 | | |
3210 | 3209 | | |
3211 | 3210 | | |
3212 | 3211 | | |
3213 | 3212 | | |
3214 | | - | |
| 3213 | + | |
3215 | 3214 | | |
3216 | 3215 | | |
3217 | 3216 | | |
| |||
0 commit comments