diff options
author | Ben Hutchings <benh@debian.org> | 2025-02-24 17:00:27 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-03-13 12:47:45 +0100 |
commit | 90d2c9352a04027bfd8e3b4b09eb14aaec033a3b (patch) | |
tree | 93f26a8b72c27c577fa02a7324ca611a9bc0d864 /fs | |
parent | 421b264078313e1caaea44572fcd61e72657b02d (diff) | |
download | linux-90d2c9352a04027bfd8e3b4b09eb14aaec033a3b.tar.gz linux-90d2c9352a04027bfd8e3b4b09eb14aaec033a3b.tar.bz2 linux-90d2c9352a04027bfd8e3b4b09eb14aaec033a3b.zip |
udf: Fix use of check_add_overflow() with mixed type arguments
Commit ebbe26fd54a9 "udf: Avoid excessive partition lengths"
introduced a use of check_add_overflow() with argument types u32,
size_t, and u32 *.
This was backported to the 5.x stable branches, where in 64-bit
configurations it results in a build error (with older compilers) or a
warning. Before commit d219d2a9a92e "overflow: Allow mixed type
arguments", which went into Linux 6.1, mixed type arguments are not
supported. That cannot be backported to 5.4 or 5.10 as it would raise
the minimum compiler version for these kernel versions.
Add a cast to make the argument types compatible.
Fixes: 1497a4484cdb ("udf: Avoid excessive partition lengths")
Fixes: 551966371e17 ("udf: Avoid excessive partition lengths")
Signed-off-by: Ben Hutchings <benh@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/udf/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index ae75df43d51c..8dae5e73a00b 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1153,7 +1153,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; /* Check whether math over bitmap won't overflow. */ if (check_add_overflow(map->s_partition_len, - sizeof(struct spaceBitmapDesc) << 3, + (u32)(sizeof(struct spaceBitmapDesc) << 3), &sum)) { udf_err(sb, "Partition %d is too long (%u)\n", p_index, map->s_partition_len); |