1. 20 1月, 2022 1 次提交
  2. 18 1月, 2022 1 次提交
  3. 17 1月, 2022 2 次提交
  4. 14 1月, 2022 1 次提交
  5. 10 1月, 2022 1 次提交
    • M
      block: don't protect submit_bio_checks by q_usage_counter · 9d497e29
      Ming Lei 提交于
      Commit cc9c884d ("block: call submit_bio_checks under q_usage_counter")
      uses q_usage_counter to protect submit_bio_checks for avoiding IO after
      disk is deleted by del_gendisk().
      
      Turns out the protection isn't necessary, because once
      blk_mq_freeze_queue_wait() in del_gendisk() returns:
      
      1) all in-flight IO has been done
      
      2) all new IO will be failed in __bio_queue_enter() because
         q_usage_counter is dead, and GD_DEAD is set
      
      3) both disk and request queue instance are safe since caller of
      submit_bio() guarantees that the disk can't be closed.
      
      Once submit_bio_checks() needn't the protection of q_usage_counter, we can
      move submit_bio_checks before calling blk_mq_submit_bio() and
      ->submit_bio(). With this change, we needn't to throttle queue with
      holding one allocated request, then precise driver tag or request won't be
      wasted in throttling. Meantime we can unify the bio check for both bio
      based and request based driver.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20220104134223.590803-1-ming.lei@redhat.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
      9d497e29
  6. 23 12月, 2021 1 次提交
  7. 22 12月, 2021 2 次提交
  8. 21 12月, 2021 3 次提交
  9. 19 12月, 2021 1 次提交
  10. 17 12月, 2021 12 次提交
  11. 16 12月, 2021 3 次提交
  12. 15 12月, 2021 2 次提交
  13. 14 12月, 2021 2 次提交
  14. 11 12月, 2021 1 次提交
  15. 08 12月, 2021 1 次提交
    • P
      block: fix single bio async DIO error handling · 75feae73
      Pavel Begunkov 提交于
      BUG: KASAN: use-after-free in io_submit_one+0x496/0x2fe0 fs/aio.c:1882
      CPU: 2 PID: 15100 Comm: syz-executor873 Not tainted 5.16.0-rc1-syzk #1
      Hardware name: Red Hat KVM, BIOS 1.13.0-2.module+el8.3.0+7860+a7792d29
      04/01/2014
      Call Trace:
        [...]
        refcount_dec_and_test include/linux/refcount.h:333 [inline]
        iocb_put fs/aio.c:1161 [inline]
        io_submit_one+0x496/0x2fe0 fs/aio.c:1882
        __do_sys_io_submit fs/aio.c:1938 [inline]
        __se_sys_io_submit fs/aio.c:1908 [inline]
        __x64_sys_io_submit+0x1c7/0x4a0 fs/aio.c:1908
        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
        do_syscall_64+0x3a/0x80 arch/x86/entry/common.c:80
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      __blkdev_direct_IO_async() returns errors from bio_iov_iter_get_pages()
      directly, in which case upper layers won't be expecting ->ki_complete
      to be called by the block layer and will terminate the request. However,
      there is also bio_endio() leading to a second ->ki_complete and a double
      free.
      
      Fixes: 54a88eb8 ("block: add single bio async direct IO helper")
      Reported-by: NGeorge Kennedy <george.kennedy@oracle.com>
      Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/c9eb786f6cef041e159e6287de131bec0719ad5c.1638907997.git.asml.silence@gmail.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
      75feae73
  16. 07 12月, 2021 5 次提交
  17. 04 12月, 2021 1 次提交