linux/fs/xfs
Long Li 362c490980 xfs: fix integer overflow in bmap intent sort comparator
xfs_bmap_update_diff_items() sorts bmap intents by inode number using
a subtraction of two xfs_ino_t (uint64_t) values, with the result
truncated to int. This is incorrect when two inode numbers differ by
more than INT_MAX (2^31 - 1), which is entirely possible on large XFS
filesystems.

Fix this by replacing the subtraction with cmp_int().

Cc: <stable@vger.kernel.org> # v4.9
Fixes: 9f3afb57d5 ("xfs: implement deferred bmbt map/unmap operations")
Signed-off-by: Long Li <leo.lilong@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2026-03-11 13:21:42 +01:00
..
libxfs xfs: fix returned valued from xfs_defer_can_append 2026-03-06 09:30:07 +01:00
scrub xfs: fix copy-paste error in previous fix 2026-02-25 13:58:48 +01:00
Kconfig
Makefile xfs: add media verification ioctl 2026-01-20 18:06:52 -08:00
xfs_acl.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_acl.h
xfs_aops.c for-7.0/block-stable-pages-20260206 2026-02-09 18:14:52 -08:00
xfs_aops.h
xfs_attr_inactive.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_attr_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_attr_item.h
xfs_attr_list.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_bio_io.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_bmap_item.c xfs: fix integer overflow in bmap intent sort comparator 2026-03-11 13:21:42 +01:00
xfs_bmap_item.h
xfs_bmap_util.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_bmap_util.h
xfs_buf.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_buf.h
xfs_buf_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_buf_item.h
xfs_buf_item_recover.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xfs_buf_mem.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xfs_buf_mem.h
xfs_dahash_test.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_dahash_test.h
xfs_dir2_readdir.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_discard.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xfs_discard.h xfs: ignore discard return value 2025-12-16 08:49:56 +01:00
xfs_dquot.c xfs: ensure dquot item is deleted from AIL only after log shutdown 2026-03-10 09:40:38 +01:00
xfs_dquot.h
xfs_dquot_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_dquot_item.h
xfs_dquot_item_recover.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_drain.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_drain.h
xfs_error.c xfs: allow setting errortags at mount time 2026-01-30 10:41:42 +01:00
xfs_error.h xfs: allow setting errortags at mount time 2026-01-30 10:41:42 +01:00
xfs_exchmaps_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_exchmaps_item.h
xfs_exchrange.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_exchrange.h
xfs_export.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_export.h
xfs_extent_busy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xfs_extent_busy.h
xfs_extfree_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_extfree_item.h
xfs_file.c mm.git review status for linus..mm-stable 2026-02-18 20:50:32 -08:00
xfs_file.h
xfs_filestream.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_filestream.h
xfs_fsmap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xfs_fsmap.h
xfs_fsops.c xfs: Refactoring the nagcount and delta calculation 2026-02-25 13:58:48 +01:00
xfs_fsops.h
xfs_globals.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_handle.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_handle.h
xfs_health.c xfs: don't report half-built inodes to fserror 2026-02-25 13:58:49 +01:00
xfs_healthmon.c xfs: fix race between healthmon unmount and read_iter 2026-03-04 10:11:47 +01:00
xfs_healthmon.h xfs: convey file I/O errors to the health monitor 2026-01-20 18:06:50 -08:00
xfs_hooks.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_hooks.h
xfs_icache.c xfs: remove redundant set null for ip->i_itemp 2026-03-10 09:39:53 +01:00
xfs_icache.h
xfs_icreate_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_icreate_item.h
xfs_inode.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_inode.h
xfs_inode_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_inode_item.h
xfs_inode_item_recover.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_ioctl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xfs_ioctl.h
xfs_ioctl32.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_ioctl32.h
xfs_iomap.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_iomap.h
xfs_iops.c xfs: new patches for Linux 7.0 2026-02-09 16:11:27 -08:00
xfs_iops.h
xfs_itable.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_itable.h
xfs_iunlink_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_iunlink_item.h
xfs_iwalk.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_iwalk.h
xfs_log.c xfs: fix undersized l_iclog_roundoff values 2026-03-10 16:19:31 +01:00
xfs_log.h xfs: move struct xfs_log_vec to xfs_log_priv.h 2026-01-21 12:57:16 +01:00
xfs_log_cil.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_log_priv.h xfs: move struct xfs_log_vec to xfs_log_priv.h 2026-01-21 12:57:16 +01:00
xfs_log_recover.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_message.c xfs: promote metadata directories and large block support 2026-01-21 12:57:17 +01:00
xfs_message.h xfs: promote metadata directories and large block support 2026-01-21 12:57:17 +01:00
xfs_mount.c xfs: autonomous self healing of filesystems [v7] 2026-01-28 10:02:20 +01:00
xfs_mount.h xfs: fix potential pointer access race in xfs_healthmon_get 2026-02-25 13:58:49 +01:00
xfs_mru_cache.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_mru_cache.h
xfs_notify_failure.c xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure 2026-02-25 13:58:49 +01:00
xfs_notify_failure.h
xfs_platform.h xfs: Add comments for usages of some macros. 2026-02-25 13:58:49 +01:00
xfs_pnfs.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_pnfs.h
xfs_pwork.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_pwork.h
xfs_qm.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_qm.h
xfs_qm_bhv.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_qm_syscalls.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_quota.h
xfs_quotaops.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_refcount_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_refcount_item.h
xfs_reflink.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_reflink.h
xfs_rmap_item.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_rmap_item.h
xfs_rtalloc.c xfs: Update lazy counters in xfs_growfs_rt_bmblock() 2026-02-25 13:58:49 +01:00
xfs_rtalloc.h
xfs_stats.c xfs: remove metafile inodes from the active inode stat 2026-02-25 13:58:48 +01:00
xfs_stats.h xfs: remove metafile inodes from the active inode stat 2026-02-25 13:58:48 +01:00
xfs_super.c xfs: cleanup inode counter stats 2026-02-25 13:58:48 +01:00
xfs_super.h
xfs_symlink.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_symlink.h
xfs_sysctl.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_sysctl.h
xfs_sysfs.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_sysfs.h
xfs_trace.c xfs: autonomous self healing of filesystems [v7] 2026-01-28 10:02:20 +01:00
xfs_trace.h xfs: improve shortform attr performance [2/3] 2026-01-28 10:16:12 +01:00
xfs_trans.c xfs: fix incorrect context handling in xfs_trans_roll 2026-01-21 12:59:10 +01:00
xfs_trans.h xfs: fix incorrect context handling in xfs_trans_roll 2026-01-21 12:59:10 +01:00
xfs_trans_ail.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
xfs_trans_buf.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_trans_dquot.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_trans_priv.h
xfs_verify_media.c xfs: fix xfs_group release bug in xfs_verify_report_losses 2026-02-25 13:58:48 +01:00
xfs_verify_media.h xfs: add media verification ioctl 2026-01-20 18:06:52 -08:00
xfs_xattr.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_xattr.h
xfs_zone_alloc.c xfs: Replace &rtg->rtg_group with rtg_group() 2026-02-25 13:58:48 +01:00
xfs_zone_alloc.h
xfs_zone_gc.c xfs: remove scratch field from struct xfs_gc_bio 2026-03-04 09:34:12 +01:00
xfs_zone_info.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00
xfs_zone_priv.h xfs: always allocate the free zone with the lowest index 2026-01-21 12:57:17 +01:00
xfs_zone_space_resv.c xfs: directly include xfs_platform.h 2026-01-21 12:57:16 +01:00