]> git.baikalelectronics.ru Git - kernel.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)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 10 Nov 2020 18:18:11 +0000 (19:18 +0100)
commit262fc7252d2e749c374556fa4ebcae521f5c1337
tree569101e67722981a5e78212c2840fabb5d4ade69
parentbf51473ddd0a27147f661a1a57268ca22da5f9a4
efi/x86: Free efi_pgd with free_pages()

Commit

  6dcf269c6858 ("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

    78037cc2d700 ("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: 6dcf269c6858 ("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>
arch/x86/platform/efi/efi_64.c