summaryrefslogtreecommitdiff
path: root/drivers/clk/aspeed/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorMuchun Song <songmuchun@bytedance.com>2026-05-25 10:52:13 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-05-31 21:50:24 -0700
commitc7bde43f6daf70e05a64fbca7efdf6fa93e057dc (patch)
tree8668bd2d973ca042d525d06188a384c090209aab /drivers/clk/aspeed/git@git.tavy.me:linux.git
parentd6b8b02a27b3dd09ec12144322b3dac46d9bc9ef (diff)
mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback
vmemmap_restore_pte() rebuilds restored vmemmap pages from a tail-page template derived from compound_head(). This is wrong when the current PTE already maps a page whose contents are not tail-page metadata. In the rollback path of vmemmap_remap_free(), the first restored PTE is backed by vmemmap_head and contains head-page metadata. Reconstructing that page from a tail-page template overwrites the head-page state and corrupts the restored vmemmap page. Fix this by copying the full page from the page currently mapped by the PTE. Also pass vmemmap_tail to the rollback walk so only PTEs backed by the shared tail page are restored, while the head PTE remains mapped to vmemmap_head. Add VM_WARN_ON_ONCE() checks for unexpected cases. Link: https://lore.kernel.org/20260525025213.2229628-1-songmuchun@bytedance.com Fixes: c0b495b91a47 ("mm/hugetlb: refactor code around vmemmap_walk") Signed-off-by: Muchun Song <songmuchun@bytedance.com> Acked-by: Kiryl Shutsemau <kas@kernel.org> Acked-by: Oscar Salvador (SUSE) <osalvador@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/clk/aspeed/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions