diff options
author | Waiman Long <[email protected]> | 2024-06-25 20:16:39 -0400 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-07-03 22:40:36 -0700 |
commit | 82f0b6f041fad768c28b4ad05a683065412c226e (patch) | |
tree | 7f007bc0ea6844f3ca068f8321d4fd83628dbfa5 /scripts/generate_rust_analyzer.py | |
parent | fa2690af573dfefb47ba6eef888797a64b6b5f3c (diff) |
mm: prevent derefencing NULL ptr in pfn_section_valid()
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/[email protected]
Fixes: 5ec8e8ea8b77 ("mm/sparsemem: fix race in accessing memory_section->usage")
Signed-off-by: Waiman Long <[email protected]>
Cc: Charan Teja Kalla <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions