mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
scsi: mpt3sas: fix an out of bound write
cpu_msix_table is allocated to store online cpus, but pci_irq_get_affinity
may return cpu_possible_mask which is then used to access cpu_msix_table.
That causes bad user experience. Fix limits access to only online cpus,
I've also added an additional test to protect from an unlikely change in
cpu_online_mask.
[mkp: checkpatch]
Fixes: 1d55abc0e9 ("scsi: mpt3sas: switch to pci_alloc_irq_vectors")
Signed-off-by: Tomas Henzl <[email protected]>
Acked-by: Suganath Prabu Subramani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
a2390348c1
commit
4a8842de8d
1 changed files with 4 additions and 1 deletions
|
|
@ -2410,8 +2410,11 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
|
|||
continue;
|
||||
}
|
||||
|
||||
for_each_cpu(cpu, mask)
|
||||
for_each_cpu_and(cpu, mask, cpu_online_mask) {
|
||||
if (cpu >= ioc->cpu_msix_table_sz)
|
||||
break;
|
||||
ioc->cpu_msix_table[cpu] = reply_q->msix_index;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue