Junxiao Bi
d09a61a935
ocfs2: fix panic on nfs server over ocfs2
...
commit e5a15e17a78d58f933d17cafedfcf7486a29f5b4 upstream.
The following kernel panic was captured when running nfs server over
ocfs2, at that time ocfs2_test_inode_bit() was checking whether one
inode locating at "blkno" 5 was valid, that is ocfs2 root inode, its
"suballoc_slot" was OCFS2_INVALID_SLOT(65535) and it was allocted from
//global_inode_alloc, but here it wrongly assumed that it was got from per
slot inode alloctor which would cause array overflow and trigger kernel
panic.
BUG: unable to handle kernel paging request at 0000000000001088
IP: [<ffffffff816f6898>] _raw_spin_lock+0x18/0xf0
PGD 1e06ba067 PUD 1e9e7d067 PMD 0
Oops: 0002 [#1 ] SMP
CPU: 6 PID: 24873 Comm: nfsd Not tainted 4.1.12-124.36.1.el6uek.x86_64 #2
Hardware name: Huawei CH121 V3/IT11SGCA1, BIOS 3.87 02/02/2018
RIP: _raw_spin_lock+0x18/0xf0
RSP: e02b:ffff88005ae97908 EFLAGS: 00010206
RAX: ffff88005ae98000 RBX: 0000000000001088 RCX: 0000000000000000
RDX: 0000000000020000 RSI: 0000000000000009 RDI: 0000000000001088
RBP: ffff88005ae97928 R08: 0000000000000000 R09: ffff880212878e00
R10: 0000000000007ff0 R11: 0000000000000000 R12: 0000000000001088
R13: ffff8800063c0aa8 R14: ffff8800650c27d0 R15: 000000000000ffff
FS: 0000000000000000(0000) GS:ffff880218180000(0000) knlGS:ffff880218180000
CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000001088 CR3: 00000002033d0000 CR4: 0000000000042660
Call Trace:
igrab+0x1e/0x60
ocfs2_get_system_file_inode+0x63/0x3a0 [ocfs2]
ocfs2_test_inode_bit+0x328/0xa00 [ocfs2]
ocfs2_get_parent+0xba/0x3e0 [ocfs2]
reconnect_path+0xb5/0x300
exportfs_decode_fh+0xf6/0x2b0
fh_verify+0x350/0x660 [nfsd]
nfsd4_putfh+0x4d/0x60 [nfsd]
nfsd4_proc_compound+0x3d3/0x6f0 [nfsd]
nfsd_dispatch+0xe0/0x290 [nfsd]
svc_process_common+0x412/0x6a0 [sunrpc]
svc_process+0x123/0x210 [sunrpc]
nfsd+0xff/0x170 [nfsd]
kthread+0xcb/0xf0
ret_from_fork+0x61/0x90
Code: 83 c2 02 0f b7 f2 e8 18 dc 91 ff 66 90 eb bf 0f 1f 40 00 55 48 89 e5 41 56 41 55 41 54 53 0f 1f 44 00 00 48 89 fb ba 00 00 02 00 <f0> 0f c1 17 89 d0 45 31 e4 45 31 ed c1 e8 10 66 39 d0 41 89 c6
RIP _raw_spin_lock+0x18/0xf0
CR2: 0000000000001088
---[ end trace 7264463cd1aac8f9 ]---
Kernel panic - not syncing: Fatal exception
Link: http://lkml.kernel.org/r/20200616183829.87211-4-junxiao.bi@oracle.com
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:38:44 -04:00
..
2019-04-05 22:29:07 +02:00
2019-11-28 18:28:41 +01:00
2016-10-10 20:16:43 -07:00
2020-01-04 13:41:03 +01:00
2016-05-12 15:52:50 -07:00
2020-04-24 07:58:58 +02:00
2016-08-02 17:31:41 -04:00
2019-11-06 12:18:11 +01:00
2016-03-25 16:37:42 -07:00
2019-11-28 18:28:53 +01:00
2019-06-22 08:17:18 +02:00
2018-11-21 09:26:00 +01:00
2019-11-28 18:29:02 +01:00
2017-10-21 17:21:36 +02:00
2019-05-21 18:48:58 +02:00
2017-11-24 08:33:42 +01:00
2016-05-26 15:35:44 -07:00
2016-10-07 18:46:26 -07:00
2019-11-06 12:18:11 +01:00
2020-01-23 08:19:38 +01:00
2020-02-28 15:42:41 +01:00
2019-10-29 09:15:08 +01:00
2016-06-24 17:23:52 -07:00
2016-04-04 10:41:08 -07:00
2019-11-28 18:28:53 +01:00
2016-10-10 20:16:43 -07:00
2020-06-30 15:38:44 -04:00
2016-10-05 18:23:56 -04:00
2017-10-21 17:21:36 +02:00
2019-12-21 10:42:08 +01:00
2016-09-27 21:06:21 -04:00
2016-03-25 16:37:42 -07:00
2016-05-19 19:12:14 -07:00
2016-08-02 17:31:41 -04:00
2019-11-28 18:29:02 +01:00
2019-11-28 18:29:02 +01:00
2020-06-30 15:38:44 -04:00
2018-05-30 07:50:22 +02:00
2016-03-25 16:37:42 -07:00
2016-10-07 21:48:36 -04:00
2019-11-28 18:28:08 +01:00
2016-05-12 15:52:50 -07:00