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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:13:06 +0000 (16:13 +0200)
commit95bcf5b14e31a232bdeb606219c5eaa5b96e285c
tree1fd9407890145e206d3b5e526fd2ecf15a7d0640
parent13a3e883ce6f2c740b4e75c1f907792fab493470
scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo()

[ Upstream commit a7043e9529f3c367cc4d82997e00be034cbe57ca ]

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: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/message/fusion/mptctl.c