WSL2-Linux-Kernel/include
Waiman Long bc17f23778 mm: prevent derefencing NULL ptr in pfn_section_valid()
[ Upstream commit 82f0b6f041fad768c28b4ad05a683065412c226e ]

Commit 5ec8e8ea8b77 ("mm/sparsemem: fix race in accessing
memory_section->usage") changed pfn_section_valid() to add a READ_ONCE()
call around "ms->usage" to fix a race with section_deactivate() where
ms->usage can be cleared.  The READ_ONCE() call, by itself, is not enough
to prevent NULL pointer dereference.  We need to check its value before
dereferencing it.

Link: https://lkml.kernel.org/r/20240626001639.1350646-1-longman@redhat.com
Fixes: 5ec8e8ea8b77 ("mm/sparsemem: fix race in accessing memory_section->usage")
Signed-off-by: Waiman Long <longman@redhat.com>
Cc: Charan Teja Kalla <quic_charante@quicinc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-18 13:07:36 +02:00
..
acpi
asm-generic arch: Introduce CONFIG_FUNCTION_ALIGNMENT 2024-04-10 16:18:49 +02:00
clocksource
crypto
drm drm/mipi-dsi: use correct return type for the DSC functions 2024-06-16 13:39:30 +02:00
dt-bindings
keys
kunit
kvm KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2024-07-05 09:14:51 +02:00
linux mm: prevent derefencing NULL ptr in pfn_section_valid() 2024-07-18 13:07:36 +02:00
math-emu
media media: cec: core: add adap_nb_transmit_canceled() callback 2024-06-16 13:39:53 +02:00
memory
misc
net netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers 2024-07-05 09:14:42 +02:00
pcmcia
ras
rdma
scsi scsi: mpi3mr: Fix ATA NCQ priority support 2024-07-05 09:14:22 +02:00
soc soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request 2024-06-16 13:39:55 +02:00
sound
target
trace tracing/net_sched: NULL pointer dereference in perf_trace_qdisc_reset() 2024-07-05 09:14:52 +02:00
uapi syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-07-05 09:14:50 +02:00
vdso
video
xen