Commit 8741d07
ublk: make sure ubq->canceling is set when queue is frozen
Now ublk driver depends on `ubq->canceling` for deciding if the request
can be dispatched via uring_cmd & io_uring_cmd_complete_in_task().
Once ubq->canceling is set, the uring_cmd can be done via ublk_cancel_cmd()
and io_uring_cmd_done().
So set ubq->canceling when queue is frozen, this way makes sure that the
flag can be observed from ublk_queue_rq() reliably, and avoids
use-after-free on uring_cmd.
Fixes: 216c8f5 ("ublk: replace monitor with cancelable uring_cmd")
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent 0449173 commit 8741d07
1 file changed
+29
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1449 | 1463 | | |
1450 | 1464 | | |
| 1465 | + | |
1451 | 1466 | | |
1452 | 1467 | | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
| 1468 | + | |
1456 | 1469 | | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | 1470 | | |
1461 | 1471 | | |
1462 | 1472 | | |
| |||
1468 | 1478 | | |
1469 | 1479 | | |
1470 | 1480 | | |
1471 | | - | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
1472 | 1488 | | |
1473 | | - | |
1474 | | - | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
1475 | 1494 | | |
1476 | 1495 | | |
1477 | 1496 | | |
1478 | | - | |
| 1497 | + | |
1479 | 1498 | | |
1480 | 1499 | | |
1481 | 1500 | | |
| |||
0 commit comments