Skip to content

Commit e4e15a0

Browse files
hyperenjugregkh
authored andcommitted
efivarfs: fix error propagation in efivar_entry_get()
commit 4b22ec1 upstream. efivar_entry_get() always returns success even if the underlying __efivar_entry_get() fails, masking errors. This may result in uninitialized heap memory being copied to userspace in the efivarfs_file_read() path. Fix it by returning the error from __efivar_entry_get(). Fixes: 2d82e62 ("efi: vars: Move efivar caching layer into efivarfs") Cc: <stable@vger.kernel.org> # v6.1+ Signed-off-by: Kohei Enju <kohei@enjuk.jp> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 14ca9fa commit e4e15a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/efivarfs/vars.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ int efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
552552
err = __efivar_entry_get(entry, attributes, size, data);
553553
efivar_unlock();
554554

555-
return 0;
555+
return err;
556556
}
557557

558558
/**

0 commit comments

Comments
 (0)