Steps to reproduce:
1. Connect PERC H355 controller to the system
2. Create RAID1 using drives connected to PERC Controller
3. Install Ubuntu 22.04.1 on VD
4. Boot into OS after installation
5. Multiple Call Traces of "array-index-out-of-bounds" are seen
Expected Behavior:
OS should boot without this Call Trace
[Fix]
[PATCH v3 0/6] Replace one-element arrays with flexible-array members
https://<email address hidden>/
48658213 scsi: megaraid_sas: Use struct_size() in code related to struct MR_PD_CFG_SEQ_NUM_SYNC
41e83026 scsi: megaraid_sas: Use struct_size() in code related to struct MR_FW_RAID_MAP
ee92366a scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_PD_CFG_SEQ_NUM_SYNC
eeb3bab7 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_DRV_RAID_MAP
204a29a1 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP_DYNAMIC
ac23b92b scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP
[Test Plan]
1. Connect PERC H355 controller to the system
2. Create RAID1 using drives connected to PERC Controller
3. Install Ubuntu 22.04.1 on VD
4. Boot into OS after installation
OS should boot without the Call Trace listed in the Impact field
SRU Justification:
[Impact]
When booted into Ubuntu 22.04.1 OS after installation, observed "Array Index out of bounds" Call Trace multiple times in dmesg.
Call Trace is as follow: out-of- bounds in /build/ linux-JjvoxS/ linux-5. 15.0/drivers/ scsi/megaraid/ megaraid_ sas_fp. c:103:32 0x52/0x5c lvl+0x4a/ 0x63 0x10/0x16 0x9/0x49 handle_ out_of_ bounds. cold+0x44/ 0x49 aidMap+ 0x194/0x580 [megaraid_sas] load_balance_ params+ 0xb9/0xc0 [megaraid_sas] nfo+0x8d/ 0x290 [megaraid_sas] init_adapter_ fusion+ 0x3ce/0x420 [megaraid_sas] setup_reply_ map+0x49/ 0xac [megaraid_sas] init_fw. cold+0x87c/ 0x10c8 [megaraid_sas] probe_one+ 0x15c/0x4e0 [megaraid_sas] probe+0x48/ 0x90 cpu_fn+ 0x17/0x30 one_work+ 0x228/0x3d0 thread+ 0x223/0x420 one_work+ 0x3d0/0x3d0 struct+ 0x50/0x50 fork+0x1f/ 0x30 ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ===
[ 6.125704] UBSAN: array-index-
[ 6.125705] index 1 is out of range for type 'MR_LD_SPAN_MAP [1]'
[ 6.125707] CPU: 0 PID: 18 Comm: kworker/0:1 Not tainted 5.15.0-53-generic #59-Ubuntu
[ 6.125709] Hardware name: Dell Inc. , BIOS 11/08/2022
[ 6.125710] Workqueue: events work_for_cpu_fn
[ 6.125716] Call Trace:
[ 6.125718] <TASK>
[ 6.125720] show_stack+
[ 6.125725] dump_stack_
[ 6.125731] dump_stack+
[ 6.125732] ubsan_epilogue+
[ 6.125734] __ubsan_
[ 6.125736] ? MR_PopulateDrvR
[ 6.125747] mr_update_
[ 6.125753] MR_ValidateMapI
[ 6.125757] megasas_
[ 6.125762] ? megasas_
[ 6.125768] megasas_
[ 6.125774] megasas_
[ 6.125779] local_pci_
[ 6.125783] work_for_
[ 6.125785] process_
[ 6.125786] worker_
[ 6.125787] ? process_
[ 6.125788] kthread+0x127/0x150
[ 6.125790] ? set_kthread_
[ 6.125791] ret_from_
[ 6.125796] </TASK>
[ 6.125796] =======
Steps to reproduce: index-out- of-bounds" are seen
1. Connect PERC H355 controller to the system
2. Create RAID1 using drives connected to PERC Controller
3. Install Ubuntu 22.04.1 on VD
4. Boot into OS after installation
5. Multiple Call Traces of "array-
Expected Behavior:
OS should boot without this Call Trace
[Fix]
[PATCH v3 0/6] Replace one-element arrays with flexible-array members
https://<email address hidden>/
48658213 scsi: megaraid_sas: Use struct_size() in code related to struct MR_PD_CFG_ SEQ_NUM_ SYNC
41e83026 scsi: megaraid_sas: Use struct_size() in code related to struct MR_FW_RAID_MAP
ee92366a scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_PD_CFG_ SEQ_NUM_ SYNC
eeb3bab7 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_DRV_RAID_MAP
204a29a1 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_ MAP_DYNAMIC
ac23b92b scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP
[Test Plan]
1. Connect PERC H355 controller to the system
2. Create RAID1 using drives connected to PERC Controller
3. Install Ubuntu 22.04.1 on VD
4. Boot into OS after installation
OS should boot without the Call Trace listed in the Impact field
[Where problems could occur]
[Other Info]
https:/ /code.launchpad .net/~mreed8855 /ubuntu/ +source/ linux/+ git/jammy/ +ref/array_ bounds_ lp_1999503