Forwarded: Re: [syzbot] [ext4?] general protection fault in __bh_submit

syzbot posted 1 patch 3 weeks, 2 days ago
Forwarded: Re: [syzbot] [ext4?] general protection fault in __bh_submit
Posted by syzbot 3 weeks, 2 days ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [ext4?] general protection fault in __bh_submit
Author: pavankumaryalagada@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 8b72f6626dc39b9e7e82b2721d4f7c3b86286012

diff --git a/fs/buffer.c b/fs/buffer.c
index 427d8a817cd5..f46fa6413032 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1106,7 +1106,8 @@ static void __bh_submit(struct buffer_head *bh, blk_opf_t opf,
 
        bio = bio_alloc(bh->b_bdev, 1, opf, GFP_NOIO);
 
-       if (folio_test_dropbehind(bh->b_folio) && op_is_write(opf))
+       if (bh->b_folio && folio_test_dropbehind(bh->b_folio) &&
+           op_is_write(opf))
                bio_set_flag(bio, BIO_COMPLETE_IN_TASK);
 
        if (IS_ENABLED(CONFIG_FS_ENCRYPTION))