Commit 82f0b6f
mm: prevent derefencing NULL ptr in pfn_section_valid()
Commit 5ec8e8e ("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: 5ec8e8e ("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>1 parent fa2690a commit 82f0b6f
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
| 1982 | + | |
1982 | 1983 | | |
1983 | | - | |
| 1984 | + | |
1984 | 1985 | | |
1985 | 1986 | | |
1986 | 1987 | | |
| |||
0 commit comments