efi/x86: Check number of arguments to variadic functions
authorArvind Sankar <nivedita@alum.mit.edu>
Fri, 3 Jan 2020 11:39:48 +0000 (12:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 10 Jan 2020 17:55:04 +0000 (18:55 +0100)
commit14b864f4b5c402fe1ca394042beeea6fdf54f8f5
tree9d5a3b3acd34f3eb4e84b7739cf1b8810129dd9c
parent4684abe375927e745974bfddd85e171a3eb887a5
efi/x86: Check number of arguments to variadic functions

On x86 we need to thunk through assembler stubs to call the EFI services
for mixed mode, and for runtime services in 64-bit mode. The assembler
stubs have limits on how many arguments it handles. Introduce a few
macros to check that we do not try to pass too many arguments to the
stubs.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Matthew Garrett <mjg59@google.com>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20200103113953.9571-16-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/boot/compressed/efi_thunk_64.S
arch/x86/include/asm/efi.h
arch/x86/platform/efi/efi_stub_64.S
arch/x86/platform/efi/efi_thunk_64.S