diff options
author | Yang, Bo <Bo.Yang@lsi.com> | 2009-10-06 16:52:20 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-29 13:03:21 -0400 |
commit | 7b2519afa1abd1b9f63aa1e90879307842422dae (patch) | |
tree | 39ed8395471eb79e5016e8d3878d489d0d2b81b7 /drivers | |
parent | 7e8a75f4dfbff173977b2f58799c3eceb7b09afd (diff) |
[SCSI] megaraid_sas: fix 64 bit sense pointer truncation
The current sense pointer is cast to a u32 pointer, which can truncate
on 64 bits. Fix by using unsigned long instead.
Signed-off-by Bo Yang<bo.yang@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index b0d6991cb6f3..23056721a8c9 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -3515,7 +3515,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, | |||
3515 | int error = 0, i; | 3515 | int error = 0, i; |
3516 | void *sense = NULL; | 3516 | void *sense = NULL; |
3517 | dma_addr_t sense_handle; | 3517 | dma_addr_t sense_handle; |
3518 | u32 *sense_ptr; | 3518 | unsigned long *sense_ptr; |
3519 | 3519 | ||
3520 | memset(kbuff_arr, 0, sizeof(kbuff_arr)); | 3520 | memset(kbuff_arr, 0, sizeof(kbuff_arr)); |
3521 | 3521 | ||
@@ -3593,7 +3593,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, | |||
3593 | } | 3593 | } |
3594 | 3594 | ||
3595 | sense_ptr = | 3595 | sense_ptr = |
3596 | (u32 *) ((unsigned long)cmd->frame + ioc->sense_off); | 3596 | (unsigned long *) ((unsigned long)cmd->frame + ioc->sense_off); |
3597 | *sense_ptr = sense_handle; | 3597 | *sense_ptr = sense_handle; |
3598 | } | 3598 | } |
3599 | 3599 | ||
@@ -3624,8 +3624,8 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, | |||
3624 | * sense_ptr points to the location that has the user | 3624 | * sense_ptr points to the location that has the user |
3625 | * sense buffer address | 3625 | * sense buffer address |
3626 | */ | 3626 | */ |
3627 | sense_ptr = (u32 *) ((unsigned long)ioc->frame.raw + | 3627 | sense_ptr = (unsigned long *) ((unsigned long)ioc->frame.raw + |
3628 | ioc->sense_off); | 3628 | ioc->sense_off); |
3629 | 3629 | ||
3630 | if (copy_to_user((void __user *)((unsigned long)(*sense_ptr)), | 3630 | if (copy_to_user((void __user *)((unsigned long)(*sense_ptr)), |
3631 | sense, ioc->sense_len)) { | 3631 | sense, ioc->sense_len)) { |