Commit 146eb58
io_uring: fix regbuf vector size truncation
There is a report of io_estimate_bvec_size() truncating the calculated
number of segments that leads to corruption issues. Check it doesn't
overflow "int"s used later. Rough but simple, can be improved on top.
Cc: stable@vger.kernel.org
Fixes: 9ef4cbb ("io_uring: add infra for importing vectored reg buffers")
Reported-by: Google Big Sleep <big-sleep-vuln-reports+bigsleep-458654612@google.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Günther Noack <gnoack@google.com>
Tested-by: Günther Noack <gnoack@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 1fd5367 commit 146eb58
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1403 | 1403 | | |
1404 | 1404 | | |
1405 | 1405 | | |
1406 | | - | |
| 1406 | + | |
1407 | 1407 | | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
1408 | 1411 | | |
1409 | 1412 | | |
1410 | 1413 | | |
| |||
1510 | 1513 | | |
1511 | 1514 | | |
1512 | 1515 | | |
1513 | | - | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1514 | 1521 | | |
1515 | 1522 | | |
1516 | 1523 | | |
| |||
0 commit comments