summaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
authorLin Ma <linma@zju.edu.cn>2023-07-23 16:00:53 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2023-07-25 21:51:04 -0400
commit47cd3770e31df942e2bb925a9a855c79ed0662eb (patch)
tree13d567513c9608f5eb9687316bbdbbd2aedc51a3 /include/scsi
parentee0268f230f66cb472df3424f380ea668da2749a (diff)
scsi: qla4xxx: Add length check when parsing nlattrs
There are three places that qla4xxx parses nlattrs: - qla4xxx_set_chap_entry() - qla4xxx_iface_set_param() - qla4xxx_sysfs_ddb_set_param() and each of them directly converts the nlattr to specific pointer of structure without length checking. This could be dangerous as those attributes are not validated and a malformed nlattr (e.g., length 0) could result in an OOB read that leaks heap dirty data. Add the nla_len check before accessing the nlattr data and return EINVAL if the length check fails. Fixes: 26ffd7b45fe9 ("[SCSI] qla4xxx: Add support to set CHAP entries") Fixes: 1e9e2be3ee03 ("[SCSI] qla4xxx: Add flash node mgmt support") Fixes: 00c31889f751 ("[SCSI] qla4xxx: fix data alignment and use nl helpers") Signed-off-by: Lin Ma <linma@zju.edu.cn> Link: https://lore.kernel.org/r/20230723080053.3714534-1-linma@zju.edu.cn Reviewed-by: Chris Leech <cleech@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi')
0 files changed, 0 insertions, 0 deletions