mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/freevxfs: reject immed inode larger than the inline area
@ 2026-10-25 22:03 Marouane El Moufid
  0 siblings, 0 replies; only message in thread
From: Marouane El Moufid @ 2026-10-25 22:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel, linux-fsdevel

vxfs_immed_read_folio() copies a full PAGE_SIZE from the 96-byte inline
immed area (vii_immed.vi_immed) without clamping to the inode size. An
"immed" inode whose on-disk size exceeds 96 bytes therefore causes an
out-of-bounds read of the vxfs_inode slab, and the bytes are returned to
userspace by read() (KASAN: slab-out-of-bounds, read of size 4096),
reachable from a mounted crafted VxFS image by read() of the file.

An immed inode stores its data inline and is always <= VXFS_NIMMED (96)
bytes; reject at iget time any immed inode that claims a larger size.

Signed-off-by: Marouane El Moufid <eun0us@espilon.net>
---
 fs/freevxfs/vxfs_inode.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -268,6 +268,11 @@
 		return ERR_PTR(error);
 	}

+	if (VXFS_ISIMMED(vip) && ip->i_size > sizeof(vip->vii_immed.vi_immed)) {
+		iget_failed(ip);
+		return ERR_PTR(-EINVAL);
+	}
+
 	if (VXFS_ISIMMED(vip))
 		aops = &vxfs_immed_aops;
 	else

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-25 22:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 22:03 [PATCH] fs/freevxfs: reject immed inode larger than the inline area Marouane El Moufid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®