linux-yocto/fs/efivarfs
Breno Leitao 64e135f1ea efivarfs: Fix memory leak of efivarfs_fs_info in fs_context error paths
When processing mount options, efivarfs allocates efivarfs_fs_info (sfi)
early in fs_context initialization. However, sfi is associated with the
superblock and typically freed when the superblock is destroyed. If the
fs_context is released (final put) before fill_super is called—such as
on error paths or during reconfiguration—the sfi structure would leak,
as ownership never transfers to the superblock.

Implement the .free callback in efivarfs_context_ops to ensure any
allocated sfi is properly freed if the fs_context is torn down before
fill_super, preventing this memory leak.

Suggested-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Fixes: 5329aa5101 ("efivarfs: Add uid/gid mount options")
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-07-18 12:00:20 +02:00
..
file.c efivarfs: Revert "allow creation of zero length files" 2025-03-07 12:31:04 +01:00
inode.c Merge branch 'efivarfs' into next 2025-01-19 17:50:58 +01:00
internal.h efivarfs: support freeze/thaw 2025-05-09 12:41:23 +02:00
Kconfig
Makefile efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
super.c efivarfs: Fix memory leak of efivarfs_fs_info in fs_context error paths 2025-07-18 12:00:20 +02:00
vars.c efivarfs: add variable resync after hibernation 2025-01-22 13:28:17 +01:00