diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2012-01-27 04:13:10 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 15:09:00 +0100 |
commit | 1304be5fe0efb42b7ec6a50dd8e1a9bce2adae17 (patch) | |
tree | bc3d95ab7c1cc5d779df4696aaa138b7cbd89825 /drivers/scsi/libiscsi.c | |
parent | [SCSI] iscsi: fix setting of pid from netlink skb (diff) | |
download | linux-1304be5fe0efb42b7ec6a50dd8e1a9bce2adae17.tar.xz linux-1304be5fe0efb42b7ec6a50dd8e1a9bce2adae17.zip |
[SCSI] libiscsi_tcp: fix max_r2t manipulation
Problem description from Xi Wang:
A large max_r2t could lead to integer overflow in subsequent call to
iscsi_tcp_r2tpool_alloc(), allocating a smaller buffer than expected
and leading to out-of-bounds write.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 00592e3bb375..8582d7c25732 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -3201,7 +3201,7 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn, sscanf(buf, "%d", &session->initial_r2t_en); break; case ISCSI_PARAM_MAX_R2T: - sscanf(buf, "%d", &session->max_r2t); + sscanf(buf, "%hu", &session->max_r2t); break; case ISCSI_PARAM_IMM_DATA_EN: sscanf(buf, "%d", &session->imm_data_en); |