BtrFS BUG: unable to handle kernel NULL pointer dereference at (null) btrfs_get_sb should return error when open_ctree failed
Issue
- Attempts to mount a broken btrfs filesystem results in a kernel NULL pointer dereference.
- Also seen when RHEL7 with a btrfs file system is re-installed with RHEL 6.4 or 6.5 (when basic storage is selected in the installation process).
- Panic looks similar to
RIP: 0010:[<ffffffff81229ddf>] [<ffffffff81229ddf>] selinux_set_mnt_opts+0x3f/0x580
RSP: 0018:ffff880438fffc58 EFLAGS: 00010292
RAX: ffffffffa045dab3 RBX: ffff880438fffce8 RCX: ffff880439a41400
RDX: 0000000000000000 RSI: ffff880438fffce8 RDI: ffff880439a41400
RBP: ffff880438fffcd8 R08: 0000000000000000 R09: 0000000000000013
R10: 000000000000000e R11: fffff000ffffffc0 R12: ffff880439a41400
R13: 0000000000000000 R14: ffff880439a41400 R15: 0000000000000000
FS: 00007f3b0e87b7e0(0000) GS:ffff880028200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000043a3c9000 CR4: 00000000000407f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process mount (pid: 2661, threadinfo ffff880438ffe000, task ffff88043973b540)
Stack:
ffff880438f639a0 ffff880438f63bd0 ffffffffa045dab3 ffff8802b959e6c0
<d> ffff880438f63530 ffff88043981c3c0 ffff880439a41400 ffff880438f63000
<d> 0000000000000000 ffff880439a41400 ffff880438fffcc8 ffff880438fffce8
Call Trace:
[<ffffffff8122a381>] superblock_doinit+0x61/0xd0
[<ffffffff8118353e>] ? deactivate_locked_super+0x5e/0x90
[<ffffffff8122a439>] selinux_sb_kern_mount+0x49/0xd0
[<ffffffff8121b526>] security_sb_kern_mount+0x16/0x20
[<ffffffff8118360b>] vfs_kern_mount+0x9b/0x1b0
[<ffffffff81183792>] do_kern_mount+0x52/0x130
[<ffffffff811a38a2>] do_mount+0x2d2/0x8d0
[<ffffffff81139d84>] ? strndup_user+0x64/0xc0
[<ffffffff811a3f30>] sys_mount+0x90/0xe0
[<ffffffff8100b072>] system_call_fastpath+0x16/0x1b
Environment
- Red Hat Enterprise Linux 6 Update 4
- Red Hat Enterprise Linux 6 Update 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.