Commit 8bc7c61
scsi: lpfc: Revise lpfc_prep_embed_io routine with proper endian macro usages
On big endian architectures, it is possible to run into a memory out of
bounds pointer dereference when FCP targets are zoned.
In lpfc_prep_embed_io, the memcpy(ptr, fcp_cmnd, sgl->sge_len) is
referencing a little endian formatted sgl->sge_len value. So, the memcpy
can cause big endian systems to crash.
Redefine the *sgl ptr as a struct sli4_sge_le to make it clear that we are
referring to a little endian formatted data structure. And, update the
routine with proper le32_to_cpu macro usages.
Fixes: af20bb7 ("scsi: lpfc: Add support for 32 byte CDBs")
Signed-off-by: Justin Tee <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>1 parent f65f31a commit 8bc7c61
1 file changed
+10
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10579 | 10579 | | |
10580 | 10580 | | |
10581 | 10581 | | |
10582 | | - | |
| 10582 | + | |
| 10583 | + | |
10583 | 10584 | | |
10584 | 10585 | | |
10585 | | - | |
| 10586 | + | |
10586 | 10587 | | |
10587 | 10588 | | |
10588 | 10589 | | |
| |||
10591 | 10592 | | |
10592 | 10593 | | |
10593 | 10594 | | |
10594 | | - | |
10595 | | - | |
10596 | | - | |
| 10595 | + | |
| 10596 | + | |
| 10597 | + | |
10597 | 10598 | | |
10598 | 10599 | | |
10599 | 10600 | | |
| |||
10602 | 10603 | | |
10603 | 10604 | | |
10604 | 10605 | | |
10605 | | - | |
| 10606 | + | |
10606 | 10607 | | |
10607 | 10608 | | |
10608 | 10609 | | |
10609 | | - | |
10610 | | - | |
10611 | | - | |
| 10610 | + | |
| 10611 | + | |
| 10612 | + | |
10612 | 10613 | | |
10613 | 10614 | | |
10614 | 10615 | | |
| |||
0 commit comments