mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-01 00:58:39 +02:00 
			
		
		
		
	|  a564ccfe30 When update_mmu_cache_range() is called by update_mmu_cache(), the vmf
parameter is NULL, which will cause a NULL pointer dereference issue in
adjust_pte():
Unable to handle kernel NULL pointer dereference at virtual address 00000030 when read
Hardware name: Atmel AT91SAM9
PC is at update_mmu_cache_range+0x1e0/0x278
LR is at pte_offset_map_rw_nolock+0x18/0x2c
Call trace:
 update_mmu_cache_range from remove_migration_pte+0x29c/0x2ec
 remove_migration_pte from rmap_walk_file+0xcc/0x130
 rmap_walk_file from remove_migration_ptes+0x90/0xa4
 remove_migration_ptes from migrate_pages_batch+0x6d4/0x858
 migrate_pages_batch from migrate_pages+0x188/0x488
 migrate_pages from compact_zone+0x56c/0x954
 compact_zone from compact_node+0x90/0xf0
 compact_node from kcompactd+0x1d4/0x204
 kcompactd from kthread+0x120/0x12c
 kthread from ret_from_fork+0x14/0x38
Exception stack(0xc0d8bfb0 to 0xc0d8bff8)
To fix it, do not rely on whether 'ptl' is equal to decide whether to hold
the pte lock, but decide it by whether CONFIG_SPLIT_PTE_PTLOCKS is
enabled.  In addition, if two vmas map to the same PTE page, there is no
need to hold the pte lock again, otherwise a deadlock will occur.  Just
add the need_lock parameter to let adjust_pte() know this information.
Link: https://lkml.kernel.org/r/20250217024924.57996-1-zhengqi.arch@bytedance.com
Fixes:  | ||
|---|---|---|
| .. | ||
| boot | ||
| common | ||
| configs | ||
| crypto | ||
| include | ||
| kernel | ||
| lib | ||
| mach-actions | ||
| mach-alpine | ||
| mach-artpec | ||
| mach-aspeed | ||
| mach-at91 | ||
| mach-axxia | ||
| mach-bcm | ||
| mach-berlin | ||
| mach-clps711x | ||
| mach-davinci | ||
| mach-digicolor | ||
| mach-dove | ||
| mach-ep93xx | ||
| mach-exynos | ||
| mach-footbridge | ||
| mach-gemini | ||
| mach-highbank | ||
| mach-hisi | ||
| mach-hpe | ||
| mach-imx | ||
| mach-ixp4xx | ||
| mach-keystone | ||
| mach-lpc18xx | ||
| mach-lpc32xx | ||
| mach-mediatek | ||
| mach-meson | ||
| mach-milbeaut | ||
| mach-mmp | ||
| mach-mstar | ||
| mach-mv78xx0 | ||
| mach-mvebu | ||
| mach-mxs | ||
| mach-nomadik | ||
| mach-npcm | ||
| mach-omap1 | ||
| mach-omap2 | ||
| mach-orion5x | ||
| mach-pxa | ||
| mach-qcom | ||
| mach-realtek | ||
| mach-rockchip | ||
| mach-rpc | ||
| mach-s3c | ||
| mach-s5pv210 | ||
| mach-sa1100 | ||
| mach-shmobile | ||
| mach-socfpga | ||
| mach-spear | ||
| mach-sti | ||
| mach-stm32 | ||
| mach-sunxi | ||
| mach-tegra | ||
| mach-ux500 | ||
| mach-versatile | ||
| mach-vt8500 | ||
| mach-zynq | ||
| mm | ||
| net | ||
| nwfpe | ||
| plat-orion | ||
| probes | ||
| tools | ||
| vdso | ||
| vfp | ||
| xen | ||
| Kbuild | ||
| Kconfig | ||
| Kconfig-nommu | ||
| Kconfig.debug | ||
| Kconfig.platforms | ||
| Makefile | ||