Qian Cai
2ea83494ce
mm/page_ext.c: fix an imbalance with kmemleak
...
[ Upstream commit 0c81585499601acd1d0e1cbf424cabfaee60628c ]
After offlining a memory block, kmemleak scan will trigger a crash, as
it encounters a page ext address that has already been freed during
memory offlining. At the beginning in alloc_page_ext(), it calls
kmemleak_alloc(), but it does not call kmemleak_free() in
free_page_ext().
BUG: unable to handle kernel paging request at ffff888453d00000
PGD 128a01067 P4D 128a01067 PUD 128a04067 PMD 47e09e067 PTE 800ffffbac2ff060
Oops: 0000 [#1 ] SMP DEBUG_PAGEALLOC KASAN PTI
CPU: 1 PID: 1594 Comm: bash Not tainted 5.0.0-rc8+ #15
Hardware name: HP ProLiant DL180 Gen9/ProLiant DL180 Gen9, BIOS U20 10/25/2017
RIP: 0010:scan_block+0xb5/0x290
Code: 85 6e 01 00 00 48 b8 00 00 30 f5 81 88 ff ff 48 39 c3 0f 84 5b 01 00 00 48 89 d8 48 c1 e8 03 42 80 3c 20 00 0f 85 87 01 00 00 <4c> 8b 3b e8 f3 0c fa ff 4c 39 3d 0c 6b 4c 01 0f 87 08 01 00 00 4c
RSP: 0018:ffff8881ec57f8e0 EFLAGS: 00010082
RAX: 0000000000000000 RBX: ffff888453d00000 RCX: ffffffffa61e5a54
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff888453d00000
RBP: ffff8881ec57f920 R08: fffffbfff4ed588d R09: fffffbfff4ed588c
R10: fffffbfff4ed588c R11: ffffffffa76ac463 R12: dffffc0000000000
R13: ffff888453d00ff9 R14: ffff8881f80cef48 R15: ffff8881f80cef48
FS: 00007f6c0e3f8740(0000) GS:ffff8881f7680000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff888453d00000 CR3: 00000001c4244003 CR4: 00000000001606a0
Call Trace:
scan_gray_list+0x269/0x430
kmemleak_scan+0x5a8/0x10f0
kmemleak_write+0x541/0x6ca
full_proxy_write+0xf8/0x190
__vfs_write+0xeb/0x980
vfs_write+0x15a/0x4f0
ksys_write+0xd2/0x1b0
__x64_sys_write+0x73/0xb0
do_syscall_64+0xeb/0xaaa
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f6c0dad73b8
Code: 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 65 63 2d 00 8b 00 85 c0 75 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 49 89 d4 55
RSP: 002b:00007ffd5b863cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007f6c0dad73b8
RDX: 0000000000000005 RSI: 000055a9216e1710 RDI: 0000000000000001
RBP: 000055a9216e1710 R08: 000000000000000a R09: 00007ffd5b863840
R10: 000000000000000a R11: 0000000000000246 R12: 00007f6c0dda9780
R13: 0000000000000005 R14: 00007f6c0dda4740 R15: 0000000000000005
Modules linked in: nls_iso8859_1 nls_cp437 vfat fat kvm_intel kvm irqbypass efivars ip_tables x_tables xfs sd_mod ahci libahci igb i2c_algo_bit libata i2c_core dm_mirror dm_region_hash dm_log dm_mod efivarfs
CR2: ffff888453d00000
---[ end trace ccf646c7456717c5 ]---
Kernel panic - not syncing: Fatal exception
Shutting down cpus with NMI
Kernel Offset: 0x24c00000 from 0xffffffff81000000 (relocation range:
0xffffffff80000000-0xffffffffbfffffff)
---[ end Kernel panic - not syncing: Fatal exception ]---
Link: http://lkml.kernel.org/r/20190227173147.75650-1-cai@lca.pw
Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-27 09:33:48 +02:00
..
2018-08-24 13:26:58 +02:00
2018-04-08 11:51:56 +02:00
2016-03-03 15:07:18 -08:00
2015-09-08 15:35:28 -07:00
2015-04-14 16:49:03 -07:00
2015-07-17 16:39:54 -07:00
2019-04-27 09:33:48 +02:00
2015-08-14 15:56:32 -07:00
2018-01-17 09:35:26 +01:00
2017-11-24 11:26:29 +01:00
2018-09-19 22:49:00 +02:00
2015-11-06 17:50:42 -08:00
2018-02-25 11:03:41 +01:00
2018-09-15 09:40:38 +02:00
2015-11-06 17:50:42 -08:00
2018-05-26 08:48:54 +02:00
2018-12-17 21:55:16 +01:00
2015-06-24 17:49:45 -07:00
2018-12-17 21:55:17 +01:00
2014-08-06 18:01:22 -07:00
2018-11-10 07:41:42 -08:00
2015-11-06 17:50:42 -08:00
2019-03-23 08:44:23 +01:00
2015-09-10 13:29:01 -07:00
2017-01-06 11:16:11 +01:00
2017-08-11 09:08:50 -07:00
2015-02-10 14:30:31 -08:00
2018-05-26 08:48:55 +02:00
2015-01-08 15:10:52 -08:00
2014-10-09 22:25:50 -04:00
2014-06-06 16:08:18 -07:00
2018-05-30 07:49:06 +02:00
2018-05-30 07:49:08 +02:00
2017-07-21 07:44:56 +02:00
2015-11-05 19:34:48 -08:00
2018-10-10 08:52:11 +02:00
2015-09-11 16:42:39 -07:00
2017-06-14 13:16:26 +02:00
2018-07-25 10:18:16 +02:00
2019-03-23 08:44:26 +01:00
2018-01-31 12:06:09 +01:00
2018-12-17 21:55:17 +01:00
2019-04-27 09:33:47 +02:00
2017-08-12 19:29:09 -07:00
2015-09-08 15:35:28 -07:00
2019-03-23 08:44:23 +01:00
2015-11-05 19:34:48 -08:00
2018-12-13 09:21:33 +01:00
2015-06-30 19:44:56 -07:00
2019-03-23 08:44:21 +01:00
2017-12-25 14:22:09 +01:00
2015-09-10 13:29:01 -07:00
2015-02-11 17:06:02 -08:00
2018-08-15 17:42:10 +02:00
2018-11-10 07:41:42 -08:00
2015-11-05 19:34:48 -08:00
2015-06-30 19:44:55 -07:00
2018-12-17 21:55:17 +01:00
2019-02-06 19:43:07 +01:00
2018-07-11 16:03:51 +02:00
2015-11-05 19:34:48 -08:00
2019-04-27 09:33:48 +02:00
2015-09-10 13:29:01 -07:00
2015-08-13 12:32:00 -06:00
2016-04-20 15:41:53 +09:00
2017-11-24 08:32:25 +01:00
2019-01-26 09:42:55 +01:00
2017-11-24 08:32:25 +01:00
2014-09-02 14:46:05 -04:00
2014-09-02 14:46:02 -04:00
2018-05-16 10:06:46 +02:00
2016-02-25 12:01:23 -08:00
2018-12-17 21:55:16 +01:00
2015-11-06 17:50:42 -08:00
2019-04-03 06:23:18 +02:00
2019-03-23 08:44:34 +01:00
2017-10-21 17:09:05 +02:00
2019-01-16 22:16:11 +01:00
2015-11-22 11:58:44 -08:00
2015-11-22 11:58:44 -08:00
2018-10-10 08:52:08 +02:00
2017-07-05 14:37:15 +02:00
2015-09-08 15:35:28 -07:00
2015-11-06 17:50:42 -08:00
2018-08-15 17:42:10 +02:00
2018-12-13 09:21:33 +01:00
2015-09-04 16:54:41 -07:00
2018-12-17 21:55:16 +01:00
2018-09-19 22:49:00 +02:00
2019-03-23 08:44:37 +01:00
2017-03-12 06:37:25 +01:00
2018-06-06 16:46:23 +02:00
2019-04-03 06:23:21 +02:00
2016-10-28 03:01:34 -04:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2016-05-18 17:06:44 -07:00
2018-09-05 09:18:36 +02:00