In the Linux kernel, the following vulnerability has been resolved:
block: disable the elevator int del_gendisk
The elevator is only used for file system requests, which are stopped in delgendisk. Move disabling the elevator and freeing the scheduler tags to the end of delgendisk instead of doing that work in diskrelease and blkcleanupqueue to avoid a use after free on q->tagset from diskrelease as the tagset might not be alive at that point.
Move the blkqosexit call as well, as it just depends on the elevator exit and would be the only reason to keep the not exactly cheap queue freeze in disk_release.