Files
kernel-spacemit-k1/drivers/md
Zichen Xie edfae9d997 dm-unstriped: cast an operand to sector_t to prevent potential uint32_t overflow
commit 5a4510c762fc04c74cff264cd4d9e9f5bf364bae upstream.

This was found by a static analyzer.
There may be a potential integer overflow issue in
unstripe_ctr(). uc->unstripe_offset and uc->unstripe_width are
defined as "sector_t"(uint64_t), while uc->unstripe,
uc->chunk_size and uc->stripes are all defined as "uint32_t".
The result of the calculation will be limited to "uint32_t"
without correct casting.
So, we recommend adding an extra cast to prevent potential
integer overflow.

Fixes: 18a5bf2705 ("dm: add unstriped target")
Signed-off-by: Zichen Xie <zichenxie0106@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-14 13:19:37 +01:00
..
2024-03-26 18:20:13 -04:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2024-03-26 18:20:13 -04:00
2024-03-26 18:20:13 -04:00
2024-03-26 18:20:13 -04:00
2024-03-26 18:20:13 -04:00
2023-02-14 14:23:06 -05:00
2024-03-26 18:20:13 -04:00
2023-07-27 00:13:30 -07:00
2023-07-27 00:13:30 -07:00
2024-08-29 17:33:35 +02:00