Thread (11 messages) 11 messages, 6 authors, 2021-01-04

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

From: James Bottomley <hidden>
Date: 2021-01-03 17:02:03
Also in: linux-scsi, lkml

On Sun, 2021-01-03 at 17:26 +0100, Arnd Bergmann wrote:
[...]
quoted hunk ↗ jump to hunk
@@ -8209,7 +8208,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance
*instance,
                if (instance->consistent_mask_64bit)
                        put_unaligned_le64(sense_handle, sense_ptr);
                else
-                       put_unaligned_le32(sense_handle, sense_ptr);
+                       put_unaligned_le64(sense_handle, sense_ptr);
        }
This hunk can't be right.  It effectively means removing the if.
However, the if is needed because sense_handle is a dma_addr_t which
can be either 32 or 64 bit.  What about changing the if to 

if (sizeof(dma_addr_t) == 8)

instead?

James

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help