In the Linux kernel, the following vulnerability has been resolved: 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 uringcmd & iouringcmdcompleteintask(). Once ubq->canceling is set, the uringcmd can be done via ublkcancelcmd() and iouringcmddone(). So set ubq->canceling when queue is frozen, this way makes sure that the flag can be observed from ublkqueuerq() reliably, and avoids use-after-free on uring_cmd.