2018-11-24 16:31:54

by Nikolai Merinov

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Nikolai Merinov <[email protected]>
---
block/partitions/efi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 39f70d968754..ea50ee1505ed 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -729,7 +729,7 @@ int efi_partition(struct parsed_partitions *state)
ARRAY_SIZE(ptes[i].partition_name));
info->volname[label_max] = 0;
while (label_count < label_max) {
- u8 c = ptes[i].partition_name[label_count] & 0xff;
+ u8 c = le16_to_cpu(ptes[i].partition_name[label_count]) & 0xff;
if (c && !isprint(c))
c = '!';
info->volname[label_count] = c;
--
2.14.1



2018-11-25 21:18:32

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] partitions/efi: Fix partition name parsing in GUID partition entry

Hi Nikolai,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on block/for-next]
[also build test WARNING on v4.20-rc3 next-20181123]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Nikolai-Merinov/partitions-efi-Fix-partition-name-parsing-in-GUID-partition-entry/20181125-060728
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

include/linux/slab.h:332:43: warning: dubious: x & !y
include/linux/slab.h:332:43: warning: dubious: x & !y
include/linux/slab.h:332:43: warning: dubious: x & !y
>> block/partitions/efi.c:732:32: warning: cast to restricted __le16

vim +732 block/partitions/efi.c

672
673 /**
674 * efi_partition(struct parsed_partitions *state)
675 * @state: disk parsed partitions
676 *
677 * Description: called from check.c, if the disk contains GPT
678 * partitions, sets up partition entries in the kernel.
679 *
680 * If the first block on the disk is a legacy MBR,
681 * it will get handled by msdos_partition().
682 * If it's a Protective MBR, we'll handle it here.
683 *
684 * We do not create a Linux partition for GPT, but
685 * only for the actual data partitions.
686 * Returns:
687 * -1 if unable to read the partition table
688 * 0 if this isn't our partition table
689 * 1 if successful
690 *
691 */
692 int efi_partition(struct parsed_partitions *state)
693 {
694 gpt_header *gpt = NULL;
695 gpt_entry *ptes = NULL;
696 u32 i;
697 unsigned ssz = bdev_logical_block_size(state->bdev) / 512;
698
699 if (!find_valid_gpt(state, &gpt, &ptes) || !gpt || !ptes) {
700 kfree(gpt);
701 kfree(ptes);
702 return 0;
703 }
704
705 pr_debug("GUID Partition Table is valid! Yea!\n");
706
707 for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
708 struct partition_meta_info *info;
709 unsigned label_count = 0;
710 unsigned label_max;
711 u64 start = le64_to_cpu(ptes[i].starting_lba);
712 u64 size = le64_to_cpu(ptes[i].ending_lba) -
713 le64_to_cpu(ptes[i].starting_lba) + 1ULL;
714
715 if (!is_pte_valid(&ptes[i], last_lba(state->bdev)))
716 continue;
717
718 put_partition(state, i+1, start * ssz, size * ssz);
719
720 /* If this is a RAID volume, tell md */
721 if (!efi_guidcmp(ptes[i].partition_type_guid, PARTITION_LINUX_RAID_GUID))
722 state->parts[i + 1].flags = ADDPART_FLAG_RAID;
723
724 info = &state->parts[i + 1].info;
725 efi_guid_to_str(&ptes[i].unique_partition_guid, info->uuid);
726
727 /* Naively convert UTF16-LE to 7 bits. */
728 label_max = min(ARRAY_SIZE(info->volname) - 1,
729 ARRAY_SIZE(ptes[i].partition_name));
730 info->volname[label_max] = 0;
731 while (label_count < label_max) {
> 732 u8 c = le16_to_cpu(ptes[i].partition_name[label_count]) & 0xff;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (3.48 kB)
.config.gz (65.02 kB)
Download all attachments

2019-12-24 09:24:18

by Nikolai Merinov

[permalink] [raw]
Subject: [PATCH v2] 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.

Signed-off-by: Nikolai Merinov <[email protected]>

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index db2fef7dfc47..51287a8a3bea 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -715,7 +715,7 @@ int efi_partition(struct parsed_partitions *state)
ARRAY_SIZE(ptes[i].partition_name));
info->volname[label_max] = 0;
while (label_count < label_max) {
- u8 c = ptes[i].partition_name[label_count] & 0xff;
+ u8 c = le16_to_cpu(ptes[i].partition_name[label_count]) & 0xff;
if (c && !isprint(c))
c = '!';
info->volname[label_count] = c;
diff --git a/block/partitions/efi.h b/block/partitions/efi.h
index 3e8576157575..0b6d5b7be111 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 {
--
2.17.1

2019-12-24 09:52:11

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v2] partitions/efi: Fix partition name parsing in GUID partition entry

On Tue, 24 Dec 2019 at 10:29, Nikolai Merinov
<[email protected]> wrote:
>
> 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.
>
> Signed-off-by: Nikolai Merinov <[email protected]>
>

Acked-by: Ard Biesheuvel <[email protected]>

> diff --git a/block/partitions/efi.c b/block/partitions/efi.c
> index db2fef7dfc47..51287a8a3bea 100644
> --- a/block/partitions/efi.c
> +++ b/block/partitions/efi.c
> @@ -715,7 +715,7 @@ int efi_partition(struct parsed_partitions *state)
> ARRAY_SIZE(ptes[i].partition_name));
> info->volname[label_max] = 0;
> while (label_count < label_max) {
> - u8 c = ptes[i].partition_name[label_count] & 0xff;
> + u8 c = le16_to_cpu(ptes[i].partition_name[label_count]) & 0xff;
> if (c && !isprint(c))
> c = '!';
> info->volname[label_count] = c;
> diff --git a/block/partitions/efi.h b/block/partitions/efi.h
> index 3e8576157575..0b6d5b7be111 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 {
> --
> 2.17.1
>

2020-01-08 14:26:48

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH v2] partitions/efi: Fix partition name parsing in GUID partition entry

> index db2fef7dfc47..51287a8a3bea 100644
> --- a/block/partitions/efi.c
> +++ b/block/partitions/efi.c
> @@ -715,7 +715,7 @@ int efi_partition(struct parsed_partitions *state)
> ARRAY_SIZE(ptes[i].partition_name));
> info->volname[label_max] = 0;
> while (label_count < label_max) {
> - u8 c = ptes[i].partition_name[label_count] & 0xff;
> + u8 c = le16_to_cpu(ptes[i].partition_name[label_count]) & 0xff;
> if (c && !isprint(c))
> c = '!';
>
This adds an overly long line. Please add a an efi_char_from_cpu or
similarly named helper to encapsulate this logic.

Otherwise the change looks good.

2020-01-13 10:29:18

by Nikolai Merinov

[permalink] [raw]
Subject: [PATCH v3] 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.

Signed-off-by: Nikolai Merinov <[email protected]>
---
block/partitions/efi.c | 3 ++-
block/partitions/efi.h | 2 +-
include/linux/efi.h | 5 +++++
3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index db2fef7dfc47..f1d0820de844 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -715,7 +715,8 @@ int efi_partition(struct parsed_partitions *state)
ARRAY_SIZE(ptes[i].partition_name));
info->volname[label_max] = 0;
while (label_count < label_max) {
- u8 c = ptes[i].partition_name[label_count] & 0xff;
+ u8 c = 0xff & efi_char16le_to_cpu(
+ ptes[i].partition_name[label_count]);
if (c && !isprint(c))
c = '!';
info->volname[label_count] = c;
diff --git a/block/partitions/efi.h b/block/partitions/efi.h
index 3e8576157575..4d4cae0bb79e 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)];
+ efi_char16le_t partition_name[72 / sizeof(efi_char16le_t)];
} __packed gpt_entry;

typedef struct _gpt_mbr_record {
diff --git a/include/linux/efi.h b/include/linux/efi.h
index aa54586db7a5..47882f2d45db 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -45,9 +45,14 @@
typedef unsigned long efi_status_t;
typedef u8 efi_bool_t;
typedef u16 efi_char16_t; /* UNICODE character */
+typedef __le16 efi_char16le_t; /* UTF16-LE */
+typedef __be16 efi_char16be_t; /* UTF16-BE */
typedef u64 efi_physical_addr_t;
typedef void *efi_handle_t;

+#define efi_char16le_to_cpu le16_to_cpu
+#define efi_char16be_to_cpu be16_to_cpu
+
/*
* The UEFI spec and EDK2 reference implementation both define EFI_GUID as
* struct { u32 a; u16; b; u16 c; u8 d[8]; }; and so the implied alignment
--
2.17.1

2020-02-18 13:41:29

by Nikolai Merinov

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

Hello,

Did you have a time to look at this patch? Should I make any modification?

Regards,
Nikolai

----- Original Message -----
> From: "n merinov" <[email protected]>
> To: [email protected], "Davidlohr Bueso" <[email protected]>, "Jens Axboe" <[email protected]>, "Ard Biesheuvel"
> <[email protected]>, [email protected], [email protected], "linux-kernel"
> <[email protected]>
> Cc: "n merinov" <[email protected]>
> Sent: Monday, January 13, 2020 3:27:23 PM
> Subject: [PATCH v3] 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.
>
> Signed-off-by: Nikolai Merinov <[email protected]>
> ---
> block/partitions/efi.c | 3 ++-
> block/partitions/efi.h | 2 +-
> include/linux/efi.h | 5 +++++
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/block/partitions/efi.c b/block/partitions/efi.c
> index db2fef7dfc47..f1d0820de844 100644
> --- a/block/partitions/efi.c
> +++ b/block/partitions/efi.c
> @@ -715,7 +715,8 @@ int efi_partition(struct parsed_partitions *state)
> ARRAY_SIZE(ptes[i].partition_name));
> info->volname[label_max] = 0;
> while (label_count < label_max) {
> - u8 c = ptes[i].partition_name[label_count] & 0xff;
> + u8 c = 0xff & efi_char16le_to_cpu(
> + ptes[i].partition_name[label_count]);
> if (c && !isprint(c))
> c = '!';
> info->volname[label_count] = c;
> diff --git a/block/partitions/efi.h b/block/partitions/efi.h
> index 3e8576157575..4d4cae0bb79e 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)];
> + efi_char16le_t partition_name[72 / sizeof(efi_char16le_t)];
> } __packed gpt_entry;
>
> typedef struct _gpt_mbr_record {
> diff --git a/include/linux/efi.h b/include/linux/efi.h
> index aa54586db7a5..47882f2d45db 100644
> --- a/include/linux/efi.h
> +++ b/include/linux/efi.h
> @@ -45,9 +45,14 @@
> typedef unsigned long efi_status_t;
> typedef u8 efi_bool_t;
> typedef u16 efi_char16_t; /* UNICODE character */
> +typedef __le16 efi_char16le_t; /* UTF16-LE */
> +typedef __be16 efi_char16be_t; /* UTF16-BE */
> typedef u64 efi_physical_addr_t;
> typedef void *efi_handle_t;
>
> +#define efi_char16le_to_cpu le16_to_cpu
> +#define efi_char16be_to_cpu be16_to_cpu
> +
> /*
> * The UEFI spec and EDK2 reference implementation both define EFI_GUID as
> * struct { u32 a; u16; b; u16 c; u8 d[8]; }; and so the implied alignment
> --
> 2.17.1

2020-02-18 18:54:13

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

On Mon, Jan 13, 2020 at 03:27:23PM +0500, Nikolai Merinov wrote:
> 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.
>
> Signed-off-by: Nikolai Merinov <[email protected]>
> ---
> block/partitions/efi.c | 3 ++-
> block/partitions/efi.h | 2 +-
> include/linux/efi.h | 5 +++++
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/block/partitions/efi.c b/block/partitions/efi.c
> index db2fef7dfc47..f1d0820de844 100644
> --- a/block/partitions/efi.c
> +++ b/block/partitions/efi.c
> @@ -715,7 +715,8 @@ int efi_partition(struct parsed_partitions *state)
> ARRAY_SIZE(ptes[i].partition_name));
> info->volname[label_max] = 0;
> while (label_count < label_max) {
> - u8 c = ptes[i].partition_name[label_count] & 0xff;
> + u8 c = 0xff & efi_char16le_to_cpu(
> + ptes[i].partition_name[label_count]);

Why are you swapping the order of the comparism to an unusual one here?

> - efi_char16_t partition_name[72 / sizeof (efi_char16_t)];
> + efi_char16le_t partition_name[72 / sizeof(efi_char16le_t)];
> } __packed gpt_entry;
>
> typedef struct _gpt_mbr_record {
> diff --git a/include/linux/efi.h b/include/linux/efi.h
> index aa54586db7a5..47882f2d45db 100644
> --- a/include/linux/efi.h
> +++ b/include/linux/efi.h
> @@ -45,9 +45,14 @@
> typedef unsigned long efi_status_t;
> typedef u8 efi_bool_t;
> typedef u16 efi_char16_t; /* UNICODE character */
> +typedef __le16 efi_char16le_t; /* UTF16-LE */
> +typedef __be16 efi_char16be_t; /* UTF16-BE */
> typedef u64 efi_physical_addr_t;
> typedef void *efi_handle_t;
>
> +#define efi_char16le_to_cpu le16_to_cpu
> +#define efi_char16be_to_cpu be16_to_cpu

I'd rather use plain __le16 and le16_to_cpu here. Also the be
variants seems to be entirely unused.

2020-02-24 11:39:20

by Nikolai Merinov

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

Hi Christoph,

> I'd rather use plain __le16 and le16_to_cpu here. Also the be
> variants seems to be entirely unused.

Looks like I misunderstood your comment from https://patchwork.kernel.org/patch/11309223/:

> Please add a an efi_char_from_cpu or similarly named helper
> to encapsulate this logic.

The "le16_to_cpu(ptes[i].partition_name[label_count])" call is the
full implementation of the "efi_char_from_cpu" logic. Do you want
to encapsulate "utf16_le_to_7bit_string" logic entirely like in
the attached version?

Regards,
Nikolai


Attachments:
v4-0001-partitions-efi-Fix-partition-name-parsing-in-GUID.patch (3.21 kB)

2020-02-24 17:09:10

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

On Mon, Feb 24, 2020 at 01:38:39PM +0200, Nikolai Merinov wrote:
> Hi Christoph,
>
> > I'd rather use plain __le16 and le16_to_cpu here. Also the be
> > variants seems to be entirely unused.
>
> Looks like I misunderstood your comment from https://patchwork.kernel.org/patch/11309223/:
>
> > Please add a an efi_char_from_cpu or similarly named helper
> > to encapsulate this logic.
>
> The "le16_to_cpu(ptes[i].partition_name[label_count])" call is the
> full implementation of the "efi_char_from_cpu" logic. Do you want
> to encapsulate "utf16_le_to_7bit_string" logic entirely like in
> the attached version?

I think I though of just the inner loop, but your new version looks even
better, so:

Reviewed-by: Christoph Hellwig <[email protected]>

2020-03-06 08:43:53

by Nikolai Merinov

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

Hi Christoph,

Should I perform any other steps in order to get this change in the master?

Regards,
Nikolai

----- Original Message -----
> From: "hch" <[email protected]>
> To: "n merinov" <[email protected]>
> Cc: "hch" <[email protected]>, "Davidlohr Bueso" <[email protected]>, "Jens Axboe" <[email protected]>, "Ard Biesheuvel"
> <[email protected]>, "linux-efi" <[email protected]>, "linux-block" <[email protected]>, "linux-kernel"
> <[email protected]>
> Sent: Monday, February 24, 2020 10:08:13 PM
> Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

> On Mon, Feb 24, 2020 at 01:38:39PM +0200, Nikolai Merinov wrote:
>> Hi Christoph,
>>
>> > I'd rather use plain __le16 and le16_to_cpu here. Also the be
>> > variants seems to be entirely unused.
>>
>> Looks like I misunderstood your comment from
>> https://patchwork.kernel.org/patch/11309223/:
>>
>> > Please add a an efi_char_from_cpu or similarly named helper
>> > to encapsulate this logic.
>>
>> The "le16_to_cpu(ptes[i].partition_name[label_count])" call is the
>> full implementation of the "efi_char_from_cpu" logic. Do you want
>> to encapsulate "utf16_le_to_7bit_string" logic entirely like in
>> the attached version?
>
> I think I though of just the inner loop, but your new version looks even
> better, so:
>
> Reviewed-by: Christoph Hellwig <[email protected]>

2020-03-06 09:26:30

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

On Fri, 6 Mar 2020 at 09:43, Nikolai Merinov
<[email protected]> wrote:
>
> Hi Christoph,
>
> Should I perform any other steps in order to get this change in the master?
>

I can take it via the EFI tree with an ack from Dave.


>
> ----- Original Message -----
> > From: "hch" <[email protected]>
> > To: "n merinov" <[email protected]>
> > Cc: "hch" <[email protected]>, "Davidlohr Bueso" <[email protected]>, "Jens Axboe" <[email protected]>, "Ard Biesheuvel"
> > <[email protected]>, "linux-efi" <[email protected]>, "linux-block" <[email protected]>, "linux-kernel"
> > <[email protected]>
> > Sent: Monday, February 24, 2020 10:08:13 PM
> > Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry
>
> > On Mon, Feb 24, 2020 at 01:38:39PM +0200, Nikolai Merinov wrote:
> >> Hi Christoph,
> >>
> >> > I'd rather use plain __le16 and le16_to_cpu here. Also the be
> >> > variants seems to be entirely unused.
> >>
> >> Looks like I misunderstood your comment from
> >> https://patchwork.kernel.org/patch/11309223/:
> >>
> >> > Please add a an efi_char_from_cpu or similarly named helper
> >> > to encapsulate this logic.
> >>
> >> The "le16_to_cpu(ptes[i].partition_name[label_count])" call is the
> >> full implementation of the "efi_char_from_cpu" logic. Do you want
> >> to encapsulate "utf16_le_to_7bit_string" logic entirely like in
> >> the attached version?
> >
> > I think I though of just the inner loop, but your new version looks even
> > better, so:
> >
> > Reviewed-by: Christoph Hellwig <[email protected]>

2020-03-06 10:16:20

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry

On Fri, 6 Mar 2020 at 10:25, Ard Biesheuvel <[email protected]> wrote:
>
> On Fri, 6 Mar 2020 at 09:43, Nikolai Merinov
> <[email protected]> wrote:
> >
> > Hi Christoph,
> >
> > Should I perform any other steps in order to get this change in the master?
> >
>
> I can take it via the EFI tree with an ack from Dave.
>

... or actually, I'm sure Dave is fine with it, so I'll just queue it
in efi/next directly (with Christoph's ack)

>
> >
> > ----- Original Message -----
> > > From: "hch" <[email protected]>
> > > To: "n merinov" <[email protected]>
> > > Cc: "hch" <[email protected]>, "Davidlohr Bueso" <[email protected]>, "Jens Axboe" <[email protected]>, "Ard Biesheuvel"
> > > <[email protected]>, "linux-efi" <[email protected]>, "linux-block" <[email protected]>, "linux-kernel"
> > > <[email protected]>
> > > Sent: Monday, February 24, 2020 10:08:13 PM
> > > Subject: Re: [PATCH v3] partitions/efi: Fix partition name parsing in GUID partition entry
> >
> > > On Mon, Feb 24, 2020 at 01:38:39PM +0200, Nikolai Merinov wrote:
> > >> Hi Christoph,
> > >>
> > >> > I'd rather use plain __le16 and le16_to_cpu here. Also the be
> > >> > variants seems to be entirely unused.
> > >>
> > >> Looks like I misunderstood your comment from
> > >> https://patchwork.kernel.org/patch/11309223/:
> > >>
> > >> > Please add a an efi_char_from_cpu or similarly named helper
> > >> > to encapsulate this logic.
> > >>
> > >> The "le16_to_cpu(ptes[i].partition_name[label_count])" call is the
> > >> full implementation of the "efi_char_from_cpu" logic. Do you want
> > >> to encapsulate "utf16_le_to_7bit_string" logic entirely like in
> > >> the attached version?
> > >
> > > I think I though of just the inner loop, but your new version looks even
> > > better, so:
> > >
> > > Reviewed-by: Christoph Hellwig <[email protected]>