<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/efivarfs, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-07-24T06:58:40Z</updated>
<entry>
<title>efivarfs: Fix memory leak of efivarfs_fs_info in fs_context error paths</title>
<updated>2025-07-24T06:58:40Z</updated>
<author>
<name>Breno Leitao</name>
</author>
<published>2025-07-16T15:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9fabe7036bb8be6071f39dc38605508f5f57b20'/>
<id>urn:sha1:e9fabe7036bb8be6071f39dc38605508f5f57b20</id>
<content type='text'>
[ Upstream commit 64e135f1eaba0bbb0cdee859af3328c68d5b9789 ]

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 &lt;James.Bottomley@HansenPartnership.com&gt;
Fixes: 5329aa5101f73c ("efivarfs: Add uid/gid mount options")
Signed-off-by: Breno Leitao &lt;leitao@debian.org&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'efi-next-for-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi</title>
<updated>2025-03-29T18:36:19Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2025-03-29T18:36:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1fa753c7b5b91c31a8efc80d74acbbfb391a9e7c'/>
<id>urn:sha1:1fa753c7b5b91c31a8efc80d74acbbfb391a9e7c</id>
<content type='text'>
Pull EFI updates from Ard Biesheuvel:

 - Decouple mixed mode startup code from the traditional x86
   decompressor

 - Revert zero-length file hack in efivarfs

 - Prevent EFI zboot from using the CopyMem/SetMem boot services after
   ExitBootServices()

 - Update EFI zboot to use the ZLIB/ZSTD library interfaces directly

* tag 'efi-next-for-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi/libstub: Avoid legacy decompressor zlib/zstd wrappers
  efi/libstub: Avoid CopyMem/SetMem EFI services after ExitBootServices
  efi: efibc: change kmalloc(size * count, ...) to kmalloc_array()
  efivarfs: Revert "allow creation of zero length files"
  x86/efi/mixed: Move mixed mode startup code into libstub
  x86/efi/mixed: Simplify and document thunking logic
  x86/efi/mixed: Remove dependency on legacy startup_32 code
  x86/efi/mixed: Set up 1:1 mapping of lower 4GiB in the stub
  x86/efi/mixed: Factor out and clean up long mode entry
  x86/efi/mixed: Check CPU compatibility without relying on verify_cpu()
  x86/efistub: Merge PE and handover entrypoints
</content>
</entry>
<entry>
<title>efivarfs: fix NULL dereference on resume</title>
<updated>2025-03-18T07:46:08Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2025-03-18T03:06:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11092db5b57377ac99e6339cfd16ca35ef011f3c'/>
<id>urn:sha1:11092db5b57377ac99e6339cfd16ca35ef011f3c</id>
<content type='text'>
LSMs often inspect the path.mnt of files in the security hooks, and this
causes a NULL deref in efivarfs_pm_notify() because the path is
constructed with a NULL path.mnt.

Fix by obtaining from vfs_kern_mount() instead, and being very careful
to ensure that deactivate_super() (potentially triggered by a racing
userspace umount) is not called directly from the notifier, because it
would deadlock when efivarfs_kill_sb() tried to unregister the notifier
chain.

[ Al notes:
	Umm...  That's probably safe, but not as a long-term solution -
	it's too intimately dependent upon fs/super.c internals. The
	reasons why you can't run into -&gt;s_umount deadlock here are
	non-trivial... ]

Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Link: https://lore.kernel.org/r/e54e6a2f-1178-4980-b771-4d9bafc2aa47@tnxip.de
Link: https://lore.kernel.org/r/3e998bf87638a442cbc6864cdcd3d8d9e08ce3e3.camel@HansenPartnership.com
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efivarfs: use I_MUTEX_CHILD nested lock to traverse variables on resume</title>
<updated>2025-03-17T17:19:02Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2025-03-17T07:23:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dec1277875a5974413068bfb67df7e87e51a189b'/>
<id>urn:sha1:dec1277875a5974413068bfb67df7e87e51a189b</id>
<content type='text'>
syzbot warns about a potential deadlock, but this is a false positive
resulting from a missing lockdep annotation: iterate_dir() locks the
parent whereas the inode_lock() it warns about locks the child, which is
guaranteed to be a different lock.

So use inode_lock_nested() instead with the appropriate lock class.

Reported-by: syzbot+019072ad24ab1d948228@syzkaller.appspotmail.com
Suggested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efivarfs: Revert "allow creation of zero length files"</title>
<updated>2025-03-07T11:31:04Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2025-03-06T13:08:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6b227e36b5ad878260f5a3a1838f2d79d5e68e9'/>
<id>urn:sha1:b6b227e36b5ad878260f5a3a1838f2d79d5e68e9</id>
<content type='text'>
As agreed with the fwupd/LVFS maintainer, this reverts commit
fc20737d8b85691ecabab3739ed7d06c9b7bc00f again for the v6.15 cycle,
leaving them sufficient time to roll out a fix for the issue that the
reverted commit works around.

Link: https://lore.kernel.org/all/63837c36eceaf8cf2af7933dccca54ff4dd9f30d.camel@HansenPartnership.com/
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efivarfs: allow creation of zero length files</title>
<updated>2025-02-27T10:27:49Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2025-02-26T21:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc20737d8b85691ecabab3739ed7d06c9b7bc00f'/>
<id>urn:sha1:fc20737d8b85691ecabab3739ed7d06c9b7bc00f</id>
<content type='text'>
Temporarily allow the creation of zero length files in efivarfs so the
'fwupd' user space firmware update tool can continue to operate. This
hack should be reverted as soon as the fwupd mechanisms for updating
firmware have been fixed.

fwupd has been coded to open a firmware file, close it, remove the
immutable bit and write to it.  Since commit 908af31f4896 ("efivarfs:
fix error on write to new variable leaving remnants") this behaviour
results in the first close removing the file which causes the second
write to fail.  To allow fwupd to keep working code up an indicator of
size 1 if a write fails and only remove the file on that condition (so
create at zero size is allowed).

Tested-by: Richard Hughes &lt;richard@hughsie.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
[ardb: replace LVFS with fwupd, as suggested by Richard]
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efivarfs: Defer PM notifier registration until .fill_super</title>
<updated>2025-02-23T16:30:05Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2025-02-23T15:48:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb6ae457bc6af58c84a7854df5e7e32ba1c6a715'/>
<id>urn:sha1:cb6ae457bc6af58c84a7854df5e7e32ba1c6a715</id>
<content type='text'>
syzbot reports an issue that turns out to be caused by the fact that the
efivarfs PM notifier may be invoked before the efivarfs_fs_info::sb
field is populated, resulting in a NULL deference.

So defer the registration until efivarfs_fill_super() is invoked.

Reported-by: syzbot+00d13e505ef530a45100@syzkaller.appspotmail.com
Tested-by: syzbot+00d13e505ef530a45100@syzkaller.appspotmail.com
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efivarfs: add variable resync after hibernation</title>
<updated>2025-01-22T12:28:17Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2025-01-07T21:31:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5d1e6ee761a109400e97ac6a1b91c57d0f6a43a'/>
<id>urn:sha1:b5d1e6ee761a109400e97ac6a1b91c57d0f6a43a</id>
<content type='text'>
Hibernation allows other OSs to boot and thus the variable state might
be altered by the time the hibernation image is resumed.  Resync the
variable state by looping over all the dentries and update the size
(in case of alteration) delete any which no-longer exist.  Finally,
loop over all efi variables creating any which don't have
corresponding dentries.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
[ardb: - apply error pointer fixup from Dan Carpenter
       - rebase onto latest version of James's efivarfs rework]
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>efivarfs: abstract initial variable creation routine</title>
<updated>2025-01-22T12:28:10Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2025-01-07T21:31:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e2f98da2071bae0f07135adb9b3efdb737aaee6'/>
<id>urn:sha1:0e2f98da2071bae0f07135adb9b3efdb737aaee6</id>
<content type='text'>
Reuse later for variable creation after hibernation

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'efivarfs' into next</title>
<updated>2025-01-19T16:50:58Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2025-01-19T16:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7b4b1f61db79fd5a3ded518526941b0e3d70abc'/>
<id>urn:sha1:e7b4b1f61db79fd5a3ded518526941b0e3d70abc</id>
<content type='text'>
</content>
</entry>
</feed>
