]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: target: core: Fix integer overflow in UNMAP bounds check
authorJunrui Luo <moonafterrain@outlook.com>
Wed, 4 Mar 2026 15:42:58 +0000 (23:42 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 11 Mar 2026 01:56:39 +0000 (21:56 -0400)
commit2bf2d65f76697820dbc4227d13866293576dd90a
tree4fe8fbfe57d6222c9244e8f06687b3d670802973
parent20ca5460e5f95163b85dda555625a27d1c120ebf
scsi: target: core: Fix integer overflow in UNMAP bounds check

sbc_execute_unmap() checks LBA + range does not exceed the device capacity,
but does not guard against LBA + range wrapping around on 64-bit overflow.

Add an overflow check matching the pattern already used for WRITE_SAME in
the same file.

Fixes: 86d7182985d2 ("target: Add sbc_execute_unmap() helper")
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881593C61AD52C69FBDB0BDAF7CA@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_sbc.c