Re: [syzbot] [btrfs?] general protection fault in create_empty_buffers (5)
From: Edward Adam Davis
Date: Thu Jan 08 2026 - 23:30:31 EST
#syz test
diff --git a/block/fops.c b/block/fops.c
index 4d32785b31d9..c0cdc950d94c 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -492,6 +492,9 @@ static int blkdev_writepages(struct address_space *mapping,
static int blkdev_read_folio(struct file *file, struct folio *folio)
{
+ if (1 << READ_ONCE(folio->mapping->host->i_blkbits) > folio_size(folio))
+ return -EIO;
+
return block_read_full_folio(folio, blkdev_get_block);
}