Commit 8197b05
io_uring: fix put_kbuf without proper locking
io_put_kbuf_comp() should only be called while holding
->completion_lock, however there is no such assumption in io_clean_op()
and thus it can corrupt ->io_buffer_comp. Take the lock there, and
workaround the only user of io_clean_op() calling it with locks. Not
the prettiest solution, but it's easier to refactor it for-next.
Fixes: cc3cec8 ("io_uring: speedup provided buffer handling")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/743e2130b73ec6d48c4c5dd15db896c433431e6d.1648212967.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent ab0ac09 commit 8197b05
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
1341 | 1343 | | |
1342 | 1344 | | |
1343 | 1345 | | |
| |||
2123 | 2125 | | |
2124 | 2126 | | |
2125 | 2127 | | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
2126 | 2134 | | |
2127 | 2135 | | |
2128 | 2136 | | |
| |||
7126 | 7134 | | |
7127 | 7135 | | |
7128 | 7136 | | |
7129 | | - | |
| 7137 | + | |
| 7138 | + | |
7130 | 7139 | | |
| 7140 | + | |
| 7141 | + | |
7131 | 7142 | | |
7132 | 7143 | | |
7133 | 7144 | | |
| |||
0 commit comments