From d5528d5e91041e68e8eab9792ce627705a0ed273 Mon Sep 17 00:00:00 2001 From: Nikolai Merinov Date: Sun, 8 Mar 2020 09:08:59 +0100 Subject: partitions/efi: Fix partition name parsing in GUID partition entry GUID partition entry defined to have a partition name as 36 UTF-16LE code units. This means that on big-endian platforms ASCII symbols would be read with 0xXX00 efi_char16_t character code. In order to correctly extract ASCII characters from a partition name field we should be converted from 16LE to CPU architecture. The problem exists on all big endian platforms. [ mingo: Minor edits. ] Fixes: eec7ecfede74 ("genhd, efi: add efi partition metadata to hd_structs") Reviewed-by: Christoph Hellwig Signed-off-by: Nikolai Merinov Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200308080859.21568-29-ardb@kernel.org Link: https://lore.kernel.org/r/797777312.1324734.1582544319435.JavaMail.zimbra@inango-systems.com/ --- block/partitions/efi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/partitions/efi.h') diff --git a/block/partitions/efi.h b/block/partitions/efi.h index 3e8576157575..5fc62fd8d9a9 100644 --- a/block/partitions/efi.h +++ b/block/partitions/efi.h @@ -88,7 +88,7 @@ typedef struct _gpt_entry { __le64 starting_lba; __le64 ending_lba; gpt_entry_attributes attributes; - efi_char16_t partition_name[72 / sizeof (efi_char16_t)]; + __le16 partition_name[72/sizeof(__le16)]; } __packed gpt_entry; typedef struct _gpt_mbr_record { -- cgit v1.2.3