]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
freevxfs: don't BUG() on unknown typed-extent type
authorFarhad Alemi <farhad.alemi@berkeley.edu>
Tue, 2 Jun 2026 03:10:08 +0000 (20:10 -0700)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:26 +0000 (15:26 +0200)
commit704d48d81dc41470e108811c32c577ada66192d4
treed4f775feb3aa34da8cddd63ea08495b5e8833ef9
parentb2117f2a795da80d3e6dd6b12774e824ef717eef
freevxfs: don't BUG() on unknown typed-extent type

vxfs_bmap_typed() handles four typed-extent types and calls BUG() in
its default case, so an on-disk typed extent with any other type value
crashes the kernel. It is reachable from ioctl(FIBMAP) on a regular
file:

  kernel BUG at fs/freevxfs/vxfs_bmap.c:230!
  RIP: vxfs_bmap_typed fs/freevxfs/vxfs_bmap.c:230 [inline]
       vxfs_bmap1+0x128a/0x12d0 fs/freevxfs/vxfs_bmap.c:257

Replace the BUG() with WARN_ON_ONCE() and return 0 -- the value
vxfs_bmap_typed() already returns on failure (and from the DEV4 case
above); vxfs_getblk() maps 0 to -EIO, so the ioctl fails cleanly.

Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Signed-off-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Link: https://patch.msgid.link/CA+0ovChveuAwv=t15dr2m09E32bM48hHJxvfeEYZOhdNiEc9Tw@mail.gmail.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/freevxfs/vxfs_bmap.c