]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
efi/x86: Free efi_pgd with free_pages()
authorArvind Sankar <nivedita@alum.mit.edu>
Tue, 10 Nov 2020 16:39:19 +0000 (11:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:27:23 +0000 (13:27 +0100)
commitb4013fde63242f76859a236ba3ca1c162cb7ebe5
tree6f1abd7b12cb239bb3114b09f1b59ce323f6cbfa
parent088ad76f42062164775af47464f56c7fc6a13fca
efi/x86: Free efi_pgd with free_pages()

[ Upstream commit c2fe61d8be491ff8188edaf22e838f819999146b ]

Commit

  d9e9a6418065 ("x86/mm/pti: Allocate a separate user PGD")

changed the PGD allocation to allocate PGD_ALLOCATION_ORDER pages, so in
the error path it should be freed using free_pages() rather than
free_page().

Commit

    06ace26f4e6f ("x86/efi: Free efi_pgd with free_pages()")

fixed one instance of this, but missed another.

Move the freeing out-of-line to avoid code duplication and fix this bug.

Fixes: d9e9a6418065 ("x86/mm/pti: Allocate a separate user PGD")
Link: https://lore.kernel.org/r/20201110163919.1134431-1-nivedita@alum.mit.edu
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/platform/efi/efi_64.c