On Sun, Mar 17, 2024 at 03:33:21AM +0100, Tim Schumacher wrote: > commit f45812cc23fb74bef62d4eb8a69fe7218f4b9f2a upstream. > > Work around a quirk in a few old (2011-ish) UEFI implementations, where > a call to `GetNextVariableName` with a buffer size larger than 512 bytes > will always return EFI_INVALID_PARAMETER. > > There is some lore around EFI variable names being up to 1024 bytes in > size, but this has no basis in the UEFI specification, and the upper > bounds are typically platform specific, and apply to the entire variable > (name plus payload). > > Given that Linux does not permit creating files with names longer than > NAME_MAX (255) bytes, 512 bytes (== 256 UTF-16 characters) is a > reasonable limit. > > Cc: <stable@xxxxxxxxxxxxxxx> # 6.1+ > Signed-off-by: Tim Schumacher <timschumi@xxxxxx> > Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx> > [timschumi@xxxxxx: adjusted diff for changed context and code move] > Signed-off-by: Tim Schumacher <timschumi@xxxxxx> > --- > Please apply this patch to stable kernel 5.15, 5.10, 5.4, and 4.19 > respectively. Kernel 6.1 and upwards were already handled via CC, > 5.15 and below required a separate patch due to a slight refactor of > surrounding code in bbc6d2c6ef22 ("efi: vars: Switch to new wrapper > layer") and a subsequent code move in 2d82e6227ea1 ("efi: vars: Move > efivar caching layer into efivarfs"). > > Please note that the upper Signed-off-by tags are remnants from the > original patch, I documented my modifications below them and added > another sign-off. As far as I was able to gather, this is the expected > format for diverged stable patches. > > I'm not sure on the specifics of manual stable backports, so let me > know in case anything doesn't follow the process. The linux-efi team > and list are on CC both for documentation/review purposes and in case > a new sign-off/ack of theirs is required. Now queued up, thanks. greg k-h