arm64/efi: map the entire UEFI vendor string before reading it
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sun, 26 Jul 2015 12:59:00 +0000 (14:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:57 +0000 (12:21 -0700)
commitb3525bdf91087473d4490ab7acc31f59821cc04a
tree51851a142369f4a8fa25943e5502867389e09e47
parent07ddeec8a096a8d6e8be2af06703b3e828c15d59
arm64/efi: map the entire UEFI vendor string before reading it

commit f91b1feada0b6f0a4d33648155b3ded2c4e0707e upstream.

At boot, the UTF-16 UEFI vendor string is copied from the system
table into a char array with a size of 100 bytes. However, this
size of 100 bytes is also used for memremapping() the source,
which may not be sufficient if the vendor string exceeds 50
UTF-16 characters, and the placement of the vendor string inside
a 4 KB page happens to leave the end unmapped.

So use the correct '100 * sizeof(efi_char16_t)' for the size of
the mapping.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: f84d02755f5a ("arm64: add EFI runtime services")
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/efi.c