• M
    virtio_blk: fix config handler race · 4678d6f9
    Michael S. Tsirkin 提交于
    Fix a theoretical race related to config work
    handler: a config interrupt might happen
    after we flush config work but before we
    reset the device. It will then cause the
    config work to run during or after reset.
    
    Two problems with this:
    - if this runs after device is gone we will get use after free
    - access of config while reset is in progress is racy
    (as layout is changing).
    
    As a solution
    1. flush after reset when we know there will be no more interrupts
    2. add a flag to disable config access before reset
    Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
    4678d6f9
virtio_blk.c 16.0 KB