This is a note to let you know that I've just added the patch titled xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xen-x86-free_p2m_page-use-memblock_free_ptr-to-free-.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 26a853a6dfd11c2154232c9a2e9a7c25a3c02ed3 Author: Mike Rapoport <rppt@xxxxxxxxxx> Date: Fri Nov 5 13:43:10 2021 -0700 xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer [ Upstream commit c486514dd40980b2dbb0e15fabddfe1324ed0197 ] free_p2m_page() wrongly passes a virtual pointer to memblock_free() that treats it as a physical address. Call memblock_free_ptr() instead that gets a virtual address to free the memory. Link: https://lkml.kernel.org/r/20210930185031.18648-3-rppt@xxxxxxxxxx Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxx> Reviewed-by: Juergen Gross <jgross@xxxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Cc: Shahab Vahedi <Shahab.Vahedi@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Stable-dep-of: 29091a52562b ("of: reserved-memory: Do not make kmemleak ignore freed address") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 9b3a9fa4a0ade..899590f1f74a5 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -197,7 +197,7 @@ static void * __ref alloc_p2m_page(void) static void __ref free_p2m_page(void *p) { if (unlikely(!slab_is_available())) { - memblock_free((unsigned long)p, PAGE_SIZE); + memblock_free_ptr(p, PAGE_SIZE); return; }