linux/fs/freevxfs
Farhad Alemi 704d48d81d
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>
2026-07-01 15:26:26 +02:00
..
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile
vxfs_bmap.c freevxfs: don't BUG() on unknown typed-extent type 2026-07-01 15:26:26 +02:00
vxfs_dir.h freevxfs: Replace one-element array with flexible array member 2024-11-06 10:42:06 +01:00
vxfs_extern.h freevxfs: relicense to GPLv2 only 2022-05-18 15:30:17 +02:00
vxfs_fshead.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vxfs_fshead.h freevxfs: relicense to GPLv2 only 2022-05-18 15:30:17 +02:00
vxfs_immed.c freevxfs: immed: fix kernel-doc param name 2023-12-20 15:02:58 -08:00
vxfs_inode.c Coccinelle-based conversion to use ->i_state accessors 2025-10-20 20:22:26 +02:00
vxfs_inode.h freevxfs: relicense to GPLv2 only 2022-05-18 15:30:17 +02:00
vxfs_lookup.c fs: add setlease to generic_ro_fops and read-only filesystem directory operations 2026-01-12 10:55:45 +01:00
vxfs_olt.c freevxfs: relicense to GPLv2 only 2022-05-18 15:30:17 +02:00
vxfs_olt.h freevxfs: relicense to GPLv2 only 2022-05-18 15:30:17 +02:00
vxfs_subr.c freevxfs: fix kernel-doc warnings 2023-02-02 22:50:03 -08:00
vxfs_super.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vxfs.h freevxfs: relicense to GPLv2 only 2022-05-18 15:30:17 +02:00