Re: [PATCH 0/2] xfs: fix potential integer overflow in sort comparators
From: Carlos Maiolino
Date: Tue Apr 07 2026 - 07:06:45 EST
On Sat, Mar 28, 2026 at 05:34:08PM +0000, Yuto Ohnuki wrote:
> Several sort comparators in XFS subtract two uint32_t values and
> return the result as int, which can overflow when the difference
> exceeds INT_MAX.
>
> Use cmp_int() instead, as was done in commit 362c49098086
> ("xfs: fix integer overflow in bmap intent sort comparator").
>
> Patch 1 fixes the deferred intent comparators (rmap, extfree, refcount).
> Patch 2 fixes the busy extent comparator.
>
> Yuto Ohnuki (2):
> xfs: fix integer overflow in deferred intent sort comparators
> xfs: fix integer overflow in busy extent sort comparator
>
> fs/xfs/xfs_extent_busy.c | 4 ++--
> fs/xfs/xfs_extfree_item.c | 2 +-
> fs/xfs/xfs_refcount_item.c | 2 +-
> fs/xfs/xfs_rmap_item.c | 2 +-
> 4 files changed, 5 insertions(+), 5 deletions(-)
>
For the series:
Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
> --
> 2.50.1
>
>
>
>
> Amazon Web Services EMEA SARL, 38 avenue John F. Kennedy, L-1855 Luxembourg, R.C.S. Luxembourg B186284
>
> Amazon Web Services EMEA SARL, Irish Branch, One Burlington Plaza, Burlington Road, Dublin 4, Ireland, branch registration number 908705
>
>
>
>