mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Vincent Mailhol" <mailhol@kernel.org>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] efi: pass NUL-inclusive sizes to ucs2_as_utf8()
Date: Wed, 09 Sep 2026 13:38:54 +0200	[thread overview]
Message-ID: <50e9d27c-8609-4a2b-87b5-bfe97fadcfd5@app.fastmail.com> (raw)
In-Reply-To: <20260908172555.3356-1-mailhol@kernel.org>

(drop x86@ from cc)

Hi Vincent,

On Tue, 8 Sep 2026, at 19:24, Vincent Mailhol wrote:
> An upcoming change will update ucs2_as_utf8() to expose a strscpy()
> style API where the size argument is the destination buffer size,
> including space for the final NUL terminator.
>
> Some EFI callers currently pass the exact number of UTF-8 payload bytes
> that they expect to copy and add the terminator themselves afterwards.
> Extend those sizes to include the final NUL terminator so the upcoming
> contract change does not truncate the converted output by one byte.
>
> Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
> ---
> Hi Ard,
>
> I saw that you pushed on efi-libstub-native-utf16 WIP branch [1] and did
> some testing, despite those changes not yet submitted for review.
>


Thanks for the review, but I am going to drop that change. I am also going
to drop the ucs2_strscpy() call from my series, and use memcpy() instead.
The guaranteed NUL terminator is not really needed for a printf() style
function, and it actually interferes with the precision handling.

Instead, I'm adding a ucs2_to_utf8() that takes a separate limit argument,
and putting efi_convert_cmdline() on its head entirely so we don't go
through the input character by character twice.

I'll have v2 out shortly, including your v3 with my tweaks on top.
Please take the time to review on list if you have the bandwidth. Thanks.

      reply	other threads:[~2026-09-09 11:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-06 13:08 [PATCH 0/7] efi/libstub: Avoid UTF-16 conversion busywork Ard Biesheuvel
2026-09-06 13:08 ` [PATCH 1/7] x86/boot: Drop pointless re-implementation of panic() Ard Biesheuvel
2026-09-06 13:08 ` [PATCH 2/7] lib/ucs2_string: Avoid WARN in library code Ard Biesheuvel
2026-09-06 13:08 ` [PATCH 3/7] efi/libstub: Use ucs2_string library for UTF-16 to UTF-8 conversion Ard Biesheuvel
2026-09-06 13:08 ` [PATCH 4/7] efi/libstub: Avoid efi_puts() for compile time constant strings Ard Biesheuvel
2026-09-06 13:08 ` [PATCH 5/7] efi/libstub: Output UTF-16 directly from vsnprintf() Ard Biesheuvel
2026-09-09 12:46   ` David Laight
2026-09-06 13:08 ` [PATCH 6/7] efi/libstub: Add support for printing human readable GUIDs Ard Biesheuvel
2026-09-06 13:08 ` [PATCH 7/7] efi/libstub: Add efi_snprintf() to construct wide strings Ard Biesheuvel
2026-09-06 22:14 ` [PATCH 0/7] efi/libstub: Avoid UTF-16 conversion busywork Vincent Mailhol
2026-09-08 17:24 ` [PATCH] efi: pass NUL-inclusive sizes to ucs2_as_utf8() Vincent Mailhol
2026-09-09 11:38   ` Ard Biesheuvel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50e9d27c-8609-4a2b-87b5-bfe97fadcfd5@app.fastmail.com \
    --to=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®