Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in __getblk_gfp

From: Jan Kara
Date: Tue Jan 30 2024 - 06:54:45 EST


On Mon 29-01-24 17:15:05, syzbot wrote:
> syzbot suspects this issue was fixed by commit:
>
> commit 6f861765464f43a71462d52026fbddfc858239a5
> Author: Jan Kara <jack@xxxxxxx>
> Date: Wed Nov 1 17:43:10 2023 +0000
>
> fs: Block writes to mounted block devices
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=116642dfe80000
> start commit: d88520ad73b7 Merge tag 'pull-nfsd-fix' of git://git.kernel..
> git tree: upstream
> kernel config: https://syzkaller.appspot.com/x/.config?x=174a257c5ae6b4fd
> dashboard link: https://syzkaller.appspot.com/bug?extid=69b40dc5fd40f32c199f
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16a77593680000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1104a593680000
>
> If the result looks correct, please mark the issue as fixed by replying with:
>
> #syz fix: fs: Block writes to mounted block devices

This doesn't look correct. The problem here really is that sysv is calling
sb_bread() under a RWLOCK - pointers_lock - in get_block(). Which more or
less shows nobody has run sysv in ages because otherwise the chances of
sleeping in atomic context are really high? Perhaps another candidate for
removal?

Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR