Gang He
2d797e9ff9
ocfs2: fix oops when writing cloned file
...
Writing a cloned file triggers a kernel oops and the user-space command
process is also killed by the system. The bug can be reproduced stably
via:
1) create a file under ocfs2 file system directory.
journalctl -b > aa.txt
2) create a cloned file for this file.
reflink aa.txt bb.txt
3) write the cloned file with dd command.
dd if=/dev/zero of=bb.txt bs=512 count=1 conv=notrunc
The dd command is killed by the kernel, then you can see the oops message
via dmesg command.
[ 463.875404] BUG: kernel NULL pointer dereference, address: 0000000000000028
[ 463.875413] #PF: supervisor read access in kernel mode
[ 463.875416] #PF: error_code(0x0000) - not-present page
[ 463.875418] PGD 0 P4D 0
[ 463.875425] Oops: 0000 [#1 ] SMP PTI
[ 463.875431] CPU: 1 PID: 2291 Comm: dd Tainted: G OE 5.3.16-2-default
[ 463.875433] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
[ 463.875500] RIP: 0010:ocfs2_refcount_cow+0xa4/0x5d0 [ocfs2]
[ 463.875505] Code: 06 89 6c 24 38 89 eb f6 44 24 3c 02 74 be 49 8b 47 28
[ 463.875508] RSP: 0018:ffffa2cb409dfce8 EFLAGS: 00010202
[ 463.875512] RAX: ffff8b1ebdca8000 RBX: 0000000000000001 RCX: ffff8b1eb73a9df0
[ 463.875515] RDX: 0000000000056a01 RSI: 0000000000000000 RDI: 0000000000000000
[ 463.875517] RBP: 0000000000000001 R08: ffff8b1eb73a9de0 R09: 0000000000000000
[ 463.875520] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
[ 463.875522] R13: ffff8b1eb922f048 R14: 0000000000000000 R15: ffff8b1eb922f048
[ 463.875526] FS: 00007f8f44d15540(0000) GS:ffff8b1ebeb00000(0000) knlGS:0000000000000000
[ 463.875529] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 463.875532] CR2: 0000000000000028 CR3: 000000003c17a000 CR4: 00000000000006e0
[ 463.875546] Call Trace:
[ 463.875596] ? ocfs2_inode_lock_full_nested+0x18b/0x960 [ocfs2]
[ 463.875648] ocfs2_file_write_iter+0xaf8/0xc70 [ocfs2]
[ 463.875672] new_sync_write+0x12d/0x1d0
[ 463.875688] vfs_write+0xad/0x1a0
[ 463.875697] ksys_write+0xa1/0xe0
[ 463.875710] do_syscall_64+0x60/0x1f0
[ 463.875743] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[ 463.875758] RIP: 0033:0x7f8f4482ed44
[ 463.875762] Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 80 00 00 00
[ 463.875765] RSP: 002b:00007fff300a79d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 463.875769] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f8f4482ed44
[ 463.875771] RDX: 0000000000000200 RSI: 000055f771b5c000 RDI: 0000000000000001
[ 463.875774] RBP: 0000000000000200 R08: 00007f8f44af9c78 R09: 0000000000000003
[ 463.875776] R10: 000000000000089f R11: 0000000000000246 R12: 000055f771b5c000
[ 463.875779] R13: 0000000000000200 R14: 0000000000000000 R15: 000055f771b5c000
This regression problem was introduced by commit e74540b28556 ("ocfs2:
protect extent tree in ocfs2_prepare_inode_for_write()").
Link: http://lkml.kernel.org/r/20200121050153.13290-1-ghe@suse.com
Fixes: e74540b28556 ("ocfs2: protect extent tree in ocfs2_prepare_inode_for_write()").
Signed-off-by: Gang He <ghe@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-02-04 03:05:23 +00:00
..
2019-09-27 15:10:34 -07:00
2020-01-25 11:31:59 -05:00
2019-11-18 14:26:43 +01:00
2020-01-26 08:54:04 -08:00
2019-12-05 17:11:48 -08:00
2019-08-30 07:27:17 -07:00
2019-08-30 07:27:17 -07:00
2020-02-03 17:03:42 +00:00
2019-05-24 17:27:11 +02:00
2020-01-21 19:02:37 +01:00
2020-01-31 15:13:22 -06:00
2019-09-19 09:42:37 -07:00
2019-11-06 18:36:01 +01:00
2019-11-23 21:44:49 -05:00
2020-01-22 14:50:03 -08:00
2020-01-14 16:14:48 +01:00
2019-09-03 09:30:56 -04:00
2019-12-18 18:07:31 +01:00
2019-12-11 16:36:56 +08:00
2019-07-19 10:42:02 -07:00
2019-08-30 07:27:17 -07:00
2020-01-21 16:46:23 +08:00
2019-11-11 09:21:59 -05:00
2020-01-06 10:09:35 +01:00
2020-01-30 15:17:05 -08:00
2020-01-30 15:39:24 -08:00
2019-12-18 18:07:31 +01:00
2019-08-30 07:27:17 -07:00
2019-07-10 18:43:43 -07:00
2020-01-16 11:09:36 +01:00
2020-01-28 15:04:53 +01:00
2019-12-18 18:07:32 +01:00
2019-12-18 18:07:32 +01:00
2019-12-18 18:07:32 +01:00
2019-10-23 17:23:46 +02:00
2020-01-03 10:39:08 -08:00
2020-01-06 08:58:23 -08:00
2019-09-19 09:42:37 -07:00
2020-01-25 03:01:56 -05:00
2019-11-29 11:29:58 +01:00
2019-09-19 09:42:37 -07:00
2020-01-14 16:14:47 +01:00
2019-11-03 21:28:45 -05:00
2019-08-30 07:27:17 -07:00
2020-01-29 14:55:47 -08:00
2019-05-21 10:50:46 +02:00
2019-12-07 16:56:00 -08:00
2019-10-23 17:23:46 +02:00
2019-05-21 10:50:46 +02:00
2019-12-18 00:03:01 -05:00
2019-09-26 10:10:44 -07:00
2020-02-04 03:05:23 +00:00
2019-08-30 08:11:25 -07:00
2019-07-19 10:42:02 -07:00
2019-12-04 08:52:55 -05:00
2019-12-14 11:13:54 -08:00
2020-01-29 11:20:24 -08:00
2020-01-08 17:05:45 -08:00
2019-08-30 07:27:17 -07:00
2019-08-30 07:27:17 -07:00
2020-01-30 15:37:41 -08:00
2019-09-12 21:05:34 -04:00
2020-01-31 12:16:36 -08:00
2019-09-19 10:06:57 -07:00
2019-09-19 10:06:57 -07:00
2019-07-19 10:42:02 -07:00
2019-08-30 07:27:18 -07:00
2019-10-12 20:49:07 -04:00
2020-01-30 15:44:12 -08:00
2020-01-20 13:59:41 +01:00
2019-09-19 09:42:37 -07:00
2019-09-17 11:48:24 -04:00
2020-01-14 13:28:28 -08:00
2020-01-30 15:24:24 -08:00
2019-12-01 14:00:59 -08:00
2019-07-19 10:42:02 -07:00
2019-08-30 07:27:17 -07:00
2019-05-21 10:50:45 +02:00
2019-11-15 14:38:29 +01:00
2020-01-31 10:30:41 -08:00
2019-05-21 10:50:45 +02:00
2019-07-16 19:23:22 -07:00
2019-07-19 10:42:02 -07:00
2019-05-21 10:50:45 +02:00
2019-12-02 18:49:30 -07:00
2020-01-24 20:40:09 +01:00
2020-01-06 20:10:26 +01:00
2019-11-15 14:38:29 +01:00
2019-06-19 17:09:55 +02:00
2019-08-03 07:02:01 -07:00
2019-08-30 19:31:09 -04:00
2019-11-30 10:44:49 -08:00
2019-12-08 11:08:28 -08:00
2019-05-21 10:50:45 +02:00
2020-01-04 13:55:09 -08:00
2019-12-18 00:03:01 -05:00
2019-05-21 10:50:45 +02:00
2020-01-29 15:45:47 -07:00
2020-01-31 12:16:36 -08:00
2019-12-08 11:08:28 -08:00
2019-08-07 21:51:47 -04:00
2019-08-19 11:00:39 -04:00
2020-01-29 19:38:34 -08:00
2019-09-06 21:28:49 +02:00
2019-09-12 21:06:14 -04:00
2019-07-16 22:52:37 -04:00
2019-05-21 10:50:45 +02:00
2020-01-31 10:30:36 -08:00
2019-07-19 10:42:02 -07:00
2020-01-22 14:47:15 -08:00
2020-01-29 18:53:37 -08:00
2020-01-31 10:30:38 -08:00
2020-01-29 13:46:44 -07:00
2020-01-29 13:46:44 -07:00
2020-01-03 09:42:52 +01:00
2019-10-29 12:43:00 -06:00
2019-06-24 09:16:47 +10:00
2019-10-14 15:04:01 -07:00
2019-12-29 09:00:58 -05:00
2020-01-03 09:42:52 +01:00
2019-05-21 10:50:45 +02:00
2019-07-16 22:52:37 -04:00
2020-01-09 08:16:12 -07:00
2020-02-01 10:36:49 -08:00
2020-01-04 13:55:09 -08:00
2019-05-30 11:26:32 -07:00
2020-01-29 11:20:24 -08:00
2020-01-20 17:01:53 -07:00
2019-12-22 09:47:47 -08:00
2019-06-17 17:36:09 -04:00
2019-05-30 11:29:53 -07:00
2020-01-04 13:55:09 -08:00
2019-09-06 21:28:49 +02:00
2020-01-23 18:20:48 +01:00
2020-01-23 10:15:28 -08:00
2019-11-15 14:38:29 +01:00
2019-08-13 16:06:52 -07:00
2019-12-07 13:21:01 -08:00
2019-12-08 14:37:36 +01:00
2020-01-20 17:03:54 -07:00
2019-10-03 14:21:35 -07:00
2019-12-18 00:03:01 -05:00
2019-05-14 09:47:50 -07:00
2020-01-14 12:20:53 +01:00
2019-12-01 20:36:41 -08:00
2019-11-15 14:38:29 +01:00
2019-05-21 10:50:45 +02:00