Commit 826ce37
io_uring: fix regbuf vector size truncation
commit 146eb58629f45f8297e83d69e64d4eea4b28d972 upstream.
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: [email protected]
Fixes: 9ef4cbb ("io_uring: add infra for importing vectored reg buffers")
Reported-by: Google Big Sleep <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
Reviewed-by: Günther Noack <[email protected]>
Tested-by: Günther Noack <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent c43fe1e commit 826ce37
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1402 | 1402 | | |
1403 | 1403 | | |
1404 | 1404 | | |
1405 | | - | |
| 1405 | + | |
1406 | 1406 | | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
1407 | 1410 | | |
1408 | 1411 | | |
1409 | 1412 | | |
| |||
1509 | 1512 | | |
1510 | 1513 | | |
1511 | 1514 | | |
1512 | | - | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1513 | 1520 | | |
1514 | 1521 | | |
1515 | 1522 | | |
| |||
0 commit comments