Re: [syzbot] general protection fault in hctx_lock

From: Jens Axboe
Date: Sun Oct 17 2021 - 18:03:48 EST


On 10/17/21 3:40 PM, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 7c832d2f9b95 Add linux-next specific files for 20211015
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=10e9df10b00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=f6ac42766a768877
> dashboard link: https://syzkaller.appspot.com/bug?extid=005b78d4c45263d656dd
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1154f80cb00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1750eeecb00000
>
> The issue was bisected to:
>
> commit f328476e373a7ce4b4d16c48fe85571044e025f5
> Author: Christoph Hellwig <hch@xxxxxx>
> Date: Tue Oct 12 10:40:45 2021 +0000
>
> blk-mq: cleanup blk_mq_submit_bio

It's a potential use-after-free using rq->mq_hctx after inserting a flush.
I'll fold in a fix, as I'm shuffling things around anyway.

--
Jens Axboe