All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] mm: kfence: remove kfence_pool from leak trace
@ 2022-06-23 11:19 ` yee.lee
  0 siblings, 0 replies; 13+ messages in thread
From: yee.lee @ 2022-06-23 11:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Yee Lee, Matthias Brugger,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

From: Yee Lee <yee.lee@mediatek.com>

Since the latest patches of kmemleak separated its address management 
to two, phys and virt, rb-trees, the kmemleak_free failed to free kfence_pool
in the virt tree. It caused unexpected scan the blocks and triggered
kfence faults.

Reference: 
https://lore.kernel.org/linux-mm/20220611035551.1823303-1-patrick.wang.shcn@gmail.com/

 ==================================================================
 BUG: KFENCE: invalid read in scan_block+0x13c/0x838

 Invalid read at 0x000000003dc26873:
  scan_block+0x13c/0x838
  scan_gray_list+0x1f0/0x478
  kmemleak_scan+0x63c/0xd64
  kmemleak_write+0x618/0x8cc
  full_proxy_write+0x70/0x138
  vfs_write+0x108/0x314
  ksys_write+0x7c/0x14c
  __arm64_sys_write+0x20/0x30
  el0_svc_common+0xa8/0x144
  do_el0_svc+0x30/0xd4
  el0_svc+0x38/0x15c
  el0t_64_sync_handler+0x88/0xf8
  el0t_64_sync+0x1a0/0x1a4

 CPU: 0 PID: 128 Comm: sh Not tainted 5.18.0-mainline-40996-g7d83a175ff4a-dirty #1
 Hardware name: linux,dummy-virt (DT)
 ==================================================================
 
This patch change to call the memblock alloc with the flag to skip leak tracking.
And the latter kmemleak_free can be removed too.


Yee Lee (1):
  mm: kfence: skip kmemleak alloc in kfence_pool

 mm/kfence/core.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

-- 
2.18.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-06-28  7:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-23 11:19 [PATCH 0/1] mm: kfence: remove kfence_pool from leak trace yee.lee
2022-06-23 11:19 ` yee.lee
2022-06-23 11:19 ` [PATCH 1/1] mm: kfence: skip kmemleak alloc in kfence_pool yee.lee
2022-06-23 11:19   ` yee.lee
2022-06-23 11:59   ` Marco Elver
2022-06-23 11:59     ` Marco Elver
2022-06-24  8:20     ` Yee Lee
2022-06-24  8:20       ` Yee Lee
2022-06-24  8:28       ` Marco Elver
2022-06-24  8:28         ` Marco Elver
2022-06-28  6:40         ` Yee Lee
2022-06-28  7:25           ` Marco Elver
2022-06-28  7:25             ` Marco Elver

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.