From: Lennart Poettering Date: Thu, 13 Nov 2025 11:35:36 +0000 (+0100) Subject: efivars: seek back to beginning in each efi_get_variable() loop X-Git-Tag: v259-rc1~70^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dbc25d84aeff8e9196c002a778fbaf91d979a1b9;p=thirdparty%2Fsystemd.git efivars: seek back to beginning in each efi_get_variable() loop We try to read again from the beginning, hence let's seek back. Apparently efivarfs doesn't strictly require this, but it's really weird that it doesn't. --- diff --git a/src/basic/efivars.c b/src/basic/efivars.c index f40c8a09e01..f54c3d22e93 100644 --- a/src/basic/efivars.c +++ b/src/basic/efivars.c @@ -114,6 +114,9 @@ int efi_get_variable( return log_debug_errno(SYNTHETIC_ERRNO(EBUSY), "Reading EFI variable '%s' failed even after %u tries, giving up.", p, try); if (try >= EFI_N_RETRIES_NO_DELAY) (void) usleep_safe(EFI_RETRY_DELAY); + + /* Start from the beginning */ + (void) lseek(fd, 0, SEEK_SET); } /* Unfortunately kernel reports EOF if there's an inconsistency between efivarfs var list and