mpage: abort loudly if null bdev

Try to mitigate this crash in xfs/032:

BUG: kernel NULL pointer dereference, address: 0000000000000008
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: Oops: 0000 [#1] SMP
CPU: 0 UID: 0 PID: 932780 Comm: (udev-worker) Tainted: G        W           6.15.0-rc1-djwx #rc1 PREEMPT(lazy)
Tainted: [W]=WARN
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-4.module+el8.8.0+21164+ed375313 04/01/2014
RIP: 0010:guard_bio_eod+0x17/0x210
Code: f0 ff 46 1c e8 da 5b 00 00 48 89 d8 5b c3 0f 0b 0f 1f 00 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 53 48
RSP: 0018:ffffc9000274f8f8 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff888105f06e00 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffea0004096840 RDI: ffff888105f06e00
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffff8881007df110 R11: ffffc9000274fa18 R12: ffffc9000274f9f8
R13: 000000000000000d R14: 0000000000000000 R15: ffffea0004096840
FS:  00007f84f15528c0(0000) GS:ffff8884aa858000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000008 CR3: 00000001052f7000 CR4: 00000000003506f0
Call Trace:
 <TASK>
 ? bio_alloc_bioset+0xcd/0x520
 ? bio_add_page+0x62/0xb0
 do_mpage_readpage+0x3da/0x730
 mpage_readahead+0x95/0x110
 ? blkdev_iomap_begin+0x70/0x70
 read_pages+0x84/0x220
 ? filemap_add_folio+0xaf/0xd0
 page_cache_ra_unbounded+0x1a7/0x240
 force_page_cache_ra+0x92/0xb0
 filemap_get_pages+0x13b/0x760
 ? current_time+0x3b/0x110
 filemap_read+0x114/0x480
 blkdev_read_iter+0x64/0x120
 vfs_read+0x290/0x390
 ksys_read+0x6f/0xe0
 do_syscall_64+0x47/0x100
 entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x7f84f1c5a25d
Code: 31 c0 e9 c6 fe ff ff 50 48 8d 3d a6 53 0a 00 e8 59 ff 01 00 66 0f 1f 84 00 00 00 00 00 80 3d 81 23 0e 00
RSP: 002b:00007ffc88a090e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 000055b4264c76b0 RCX: 00007f84f1c5a25d
RDX: 0000000000000400 RSI: 000055b4264e84a8 RDI: 0000000000000010
RBP: 0000000000000c00 R08: 00007f84f1d35380 R09: 00007f84f1d35380
R10: 0000000000000000 R11: 0000000000000246 R12: 000055b4264e8480
R13: 0000000000000400 R14: 000055b4264c7708 R15: 000055b4264e8498
 </TASK>

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
1 file changed