]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 25 Jan 2018 14:27:27 +0000 (17:27 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 11 Jun 2020 18:05:41 +0000 (19:05 +0100)
commitb79b2c774d18d9f742c6dee7c8af3d8fd75d1852
tree0ccf1d252b7c55ace7c3fc6c40f2635d8a86f67b
parent575f200adca1fe48df15063b1a5673a9b5f713bd
scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo()

commit a7043e9529f3c367cc4d82997e00be034cbe57ca upstream.

My static checker complains about an out of bounds read:

    drivers/message/fusion/mptctl.c:2786 mptctl_hp_targetinfo()
    error: buffer overflow 'hd->sel_timeout' 255 <= u32max.

It's true that we probably should have a bounds check here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/message/fusion/mptctl.c