]> www.infradead.org Git - users/jedix/linux-maple.git/commit
efivarfs: prevent setting of zero size on the inodes in the cache
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 19 Jan 2025 14:59:40 +0000 (09:59 -0500)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 19 Jan 2025 16:49:10 +0000 (17:49 +0100)
commit8b4bc207f981bd87728d2e1c0cf6f4304f9d0159
tree2745571bef27e2b86d9fa14e53d9846ae9ef22c1
parent19fdc68aa7b90b1d3d600e873a3e050a39e7663d
efivarfs: prevent setting of zero size on the inodes in the cache

Current efivarfs uses simple_setattr which allows the setting of any
size in the inode cache.  This is wrong because a zero size file is
used to indicate an "uncommitted" variable, so by simple means of
truncating the file (as root) any variable may be turned to look like
it's uncommitted.  Fix by adding an efivarfs_setattr routine which
does not allow updating of the cached inode size (which now only comes
from the underlying variable).

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
fs/efivarfs/inode.c