devm_memremap_pages() triggers a kasan_add_zero_shadow() warning
From: Qian Cai
Date: Fri Aug 16 2019 - 17:35:52 EST
Every so often recently, booting Intel CPU server on linux-next triggers this
warning. Trying to figure out if the commit 7cc7867fb061
("mm/devm_memremap_pages: enable sub-section remap") is the culprit here.
# ./scripts/faddr2line vmlinux devm_memremap_pages+0x894/0xc70
devm_memremap_pages+0x894/0xc70:
devm_memremap_pages at mm/memremap.c:307
[ÂÂÂ32.074412][ÂÂT294] WARNING: CPU: 31 PID: 294 at mm/kasan/init.c:496
kasan_add_zero_shadow.cold.2+0xc/0x39
[ÂÂÂ32.077448][ÂÂT294] Modules linked in:
[ÂÂÂ32.078614][ÂÂT294] CPU: 31 PID: 294 Comm: kworker/u97:1 Not tainted 5.3.0-
rc4-next-20190816+ #7
[ÂÂÂ32.081299][ÂÂT294] Hardware name: HP ProLiant XL420 Gen9/ProLiant XL420
Gen9, BIOS U19 12/27/2015
[ÂÂÂ32.084430][ÂÂT294] Workqueue: events_unbound async_run_entry_fn
[ÂÂÂ32.086347][ÂÂT294] RIP: 0010:kasan_add_zero_shadow.cold.2+0xc/0x39
[ÂÂÂ32.088303][ÂÂT294] Code: ff 48 c7 c7 b0 06 74 86 e8 0e e2 db ff 0f 0b e9 64
f7 ff ff 48 8b 45 98 48 89 45 b8 eb be 48 c7 c7 b0 06 74 86 e8 f1 e1 db ff <0f>
0b b8 ea ff ff ff e9 ad fe ff ff 48 c7 c7 b0 06 74 86 e8 d9 e1
[ÂÂÂ32.094183][ÂÂT294] RSP: 0000:ffff8884428cf738 EFLAGS: 00010282
[ÂÂÂ32.096030][ÂÂT294] RAX: 0000000000000024 RBX: ffff88833c1b8100 RCX:
ffffffff85730ba8
[ÂÂÂ32.098391][ÂÂT294] RDX: 0000000000000000 RSI: dffffc0000000000 RDI:
ffffffff86964740
[ÂÂÂ32.100802][ÂÂT294] RBP: ffff8884428cf750 R08: fffffbfff0d2c8e9 R09:
fffffbfff0d2c8e9
[ÂÂÂ32.103229][ÂÂT294] R10: fffffbfff0d2c8e8 R11: ffffffff86964743 R12:
1ffff11088519ef3
[ÂÂÂ32.105581][ÂÂT294] R13: ffff88833dbc8010 R14: 000000017a02c000 R15:
ffff88833c1b8128
[ÂÂÂ32.107956][ÂÂT294] FS:ÂÂ0000000000000000(0000) GS:ffff88844db80000(0000)
knlGS:0000000000000000
[ÂÂÂ32.110585][ÂÂT294] CS:ÂÂ0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ÂÂÂ32.112606][ÂÂT294] CR2: 0000000000000000 CR3: 0000000163012001 CR4:
00000000001606a0
[ÂÂÂ32.112610][ÂÂT294] Call Trace:
[ÂÂÂ32.112622][ÂÂT294]ÂÂdevm_memremap_pages+0x894/0xc70
[ÂÂÂ32.112635][ÂÂT294]ÂÂ? devm_memremap_pages_release+0x510/0x510
[ÂÂÂ32.119291][ÂÂT294]ÂÂ? do_raw_read_unlock+0x2c/0x60
[ÂÂÂ32.122470][ÂÂT332] namespace0.0 initialised, 400896 pages in 50ms
[ÂÂÂ32.143086][ÂÂT294]ÂÂ? _raw_read_unlock+0x27/0x40
[ÂÂÂ32.143094][ÂÂT294]ÂÂpmem_attach_disk+0x490/0x880
[ÂÂÂ32.143106][ÂÂT294]ÂÂ? pmem_pagemap_kill+0x30/0x30
[ÂÂÂ32.186834][ÂÂÂÂT1] debug: unmapping init [mem 0xffffffff9d602000-
0xffffffff9d7fffff]
[ÂÂÂ32.195383][ÂÂT294]ÂÂ? kfree+0x106/0x400
[ÂÂÂ32.195394][ÂÂT294]ÂÂ? kfree_const+0x17/0x30
[ÂÂÂ32.314107][ÂÂT294]ÂÂ? kobject_put+0xfb/0x250
[ÂÂÂ32.334569][ÂÂT294]ÂÂ? put_device+0x13/0x20
[ÂÂÂ32.354169][ÂÂT294]ÂÂnd_pmem_probe+0x83/0xa0
[ÂÂÂ32.374162][ÂÂT294]ÂÂnvdimm_bus_probe+0xaa/0x1f0
[ÂÂÂ32.395901][ÂÂT294]ÂÂreally_probe+0x1a2/0x630
[ÂÂÂ32.416352][ÂÂT294]ÂÂdriver_probe_device+0xcd/0x1f0
[ÂÂÂ32.438901][ÂÂT294]ÂÂ__device_attach_driver+0xed/0x150
[ÂÂÂ32.463074][ÂÂT294]ÂÂ? driver_allows_async_probing+0x90/0x90
[ÂÂÂ32.489538][ÂÂT294]ÂÂbus_for_each_drv+0xfa/0x160
[ÂÂÂ32.511038][ÂÂT294]ÂÂ? bus_rescan_devices+0x20/0x20
[ÂÂÂ32.731179][ÂÂT294]ÂÂ? do_raw_spin_unlock+0xa8/0x140
[ÂÂÂ32.754475][ÂÂT294]ÂÂ__device_attach+0x16d/0x220
[ÂÂÂ32.775648][ÂÂT294]ÂÂ? device_bind_driver+0x80/0x80
[ÂÂÂ32.798379][ÂÂT294]ÂÂ? __kasan_check_write+0x14/0x20
[ÂÂÂ32.821550][ÂÂT294]ÂÂ? wait_for_completion_io+0x20/0x20
[ÂÂÂ32.846143][ÂÂT294]ÂÂdevice_initial_probe+0x13/0x20
[ÂÂÂ32.868959][ÂÂT294]ÂÂbus_probe_device+0x10f/0x130
[ÂÂÂ32.891093][ÂÂT294]ÂÂdevice_add+0xadb/0xd00
[ÂÂÂ32.910946][ÂÂT294]ÂÂ? root_device_unregister+0x40/0x40
[ÂÂÂ32.935477][ÂÂT294]ÂÂ? nd_synchronize+0x20/0x20
[ÂÂÂ32.956715][ÂÂT294]ÂÂnd_async_device_register+0x12/0x40
[ÂÂÂ32.981106][ÂÂT294]ÂÂasync_run_entry_fn+0x7f/0x2d0
[ÂÂÂ33.003537][ÂÂT294]ÂÂprocess_one_work+0x53b/0xa70
[ÂÂÂ33.026673][ÂÂT294]ÂÂ? pwq_dec_nr_in_flight+0x170/0x170
[ÂÂÂ33.051060][ÂÂT294]ÂÂworker_thread+0x63/0x5b0
[ÂÂÂ33.071431][ÂÂT294]ÂÂkthread+0x1df/0x200
[ÂÂÂ33.089767][ÂÂT294]ÂÂ? process_one_work+0xa70/0xa70
[ÂÂÂ33.112635][ÂÂT294]ÂÂ? kthread_park+0xc0/0xc0
[ÂÂÂ33.132698][ÂÂT294]ÂÂret_from_fork+0x35/0x40
[ÂÂÂ33.155214][ÂÂT294] ---[ end trace 6917fee95b72ffee ]---
[ÂÂÂ33.182365][ÂÂÂÂT1] debug: unmapping init [mem 0xffffffff86e7b000-
0xffffffff87031fff]
[ÂÂÂ33.184491][ÂÂT332] pmem0: detected capacity change from 0 to 1642070016
[ÂÂÂ33.251029][ÂÂT294] nd_pmem: probe of namespace1.0 failed with error -22