summaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorMuchun Song <songmuchun@bytedance.com>2023-07-07 11:38:59 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-08-18 10:12:14 -0700
commit3ce2c24cb68f228590a053d6058a5901cd31af61 (patch)
tree4f21e8ea3a9ad59fb2d0ebfce568cdc69e4f8148 /mm/memory.c
parentc200a7119bc7dc9430e8287563e5343b154ff9d0 (diff)
downloadlinux-stable-3ce2c24cb68f228590a053d6058a5901cd31af61.tar.gz
linux-stable-3ce2c24cb68f228590a053d6058a5901cd31af61.tar.bz2
linux-stable-3ce2c24cb68f228590a053d6058a5901cd31af61.zip
mm: hugetlb_vmemmap: fix a race between vmemmap pmd split
The local variable @page in __split_vmemmap_huge_pmd() to obtain a pmd page without holding page_table_lock may possiblely get the page table page instead of a huge pmd page. The effect may be in set_pte_at() since we may pass an invalid page struct, if set_pte_at() wants to access the page struct (e.g. CONFIG_PAGE_TABLE_CHECK is enabled), it may crash the kernel. So fix it. And inline __split_vmemmap_huge_pmd() since it only has one user. Link: https://lkml.kernel.org/r/20230707033859.16148-1-songmuchun@bytedance.com Fixes: d8d55f5616cf ("mm: sparsemem: use page table lock to protect kernel pmd operations") Signed-off-by: Muchun Song <songmuchun@bytedance.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
0 files changed, 0 insertions, 0 deletions