<div dir="ltr">Hi Tim,<div><br></div><div>Thank you for reviewing it.  I am always learning here, so I wanted to know what was weird about the submission so I can avoid that in future submissions.</div><div><br></div><div>Thanks,</div><div>Michael</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 23, 2023 at 12:37 PM Tim Gardner <<a href="mailto:tim.gardner@canonical.com">tim.gardner@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/23/23 9:57 AM, Michael Reed wrote:<br>
> From: Michael Reed <<a href="mailto:Michael.Reed@canonical.com" target="_blank">Michael.Reed@canonical.com</a>><br>
> <br>
> SRU Justification:<br>
> <br>
> BugLink: <a href="https://bugs.launchpad.net/bugs/2008157" rel="noreferrer" target="_blank">https://bugs.launchpad.net/bugs/2008157</a><br>
> <br>
> [Impact]<br>
> <br>
> When booted into Ubuntu 22.04.1 OS after installation, observed "Array Index out of bounds" Call Trace multiple times in dmesg.<br>
> <br>
> Call Trace is as follow:<br>
> [ 6.125704] UBSAN: array-index-out-of-bounds in /build/linux-JjvoxS/linux-5.15.0/drivers/scsi/megaraid/megaraid_sas_fp.c:103:32<br>
> [ 6.125705] index 1 is out of range for type 'MR_LD_SPAN_MAP [1]'<br>
> [ 6.125707] CPU: 0 PID: 18 Comm: kworker/0:1 Not tainted 5.15.0-53-generic #59-Ubuntu<br>
> [ 6.125709] Hardware name: Dell Inc. , BIOS 11/08/2022<br>
> [ 6.125710] Workqueue: events work_for_cpu_fn<br>
> [ 6.125716] Call Trace:<br>
> [ 6.125718] <TASK><br>
> [ 6.125720] show_stack+0x52/0x5c<br>
> [ 6.125725] dump_stack_lvl+0x4a/0x63<br>
> [ 6.125731] dump_stack+0x10/0x16<br>
> [ 6.125732] ubsan_epilogue+0x9/0x49<br>
> [ 6.125734] __ubsan_handle_out_of_bounds.cold+0x44/0x49<br>
> [ 6.125736] ? MR_PopulateDrvRaidMap+0x194/0x580 [megaraid_sas]<br>
> [ 6.125747] mr_update_load_balance_params+0xb9/0xc0 [megaraid_sas]<br>
> [ 6.125753] MR_ValidateMapInfo+0x8d/0x290 [megaraid_sas]<br>
> [ 6.125757] megasas_init_adapter_fusion+0x3ce/0x420 [megaraid_sas]<br>
> [ 6.125762] ? megasas_setup_reply_map+0x49/0xac [megaraid_sas]<br>
> [ 6.125768] megasas_init_fw.cold+0x87c/0x10c8 [megaraid_sas]<br>
> [ 6.125774] megasas_probe_one+0x15c/0x4e0 [megaraid_sas]<br>
> [ 6.125779] local_pci_probe+0x48/0x90<br>
> [ 6.125783] work_for_cpu_fn+0x17/0x30<br>
> [ 6.125785] process_one_work+0x228/0x3d0<br>
> [ 6.125786] worker_thread+0x223/0x420<br>
> [ 6.125787] ? process_one_work+0x3d0/0x3d0<br>
> [ 6.125788] kthread+0x127/0x150<br>
> [ 6.125790] ? set_kthread_struct+0x50/0x50<br>
> [ 6.125791] ret_from_fork+0x1f/0x30<br>
> [ 6.125796] </TASK><br>
> [ 6.125796] ================================================================================<br>
> <br>
> Steps to reproduce:<br>
> 1. Connect PERC H355 controller to the system<br>
> 2. Create RAID1 using drives connected to PERC Controller<br>
> 3. Install Ubuntu 22.04.1 on VD<br>
> 4. Boot into OS after installation<br>
> 5. Multiple Call Traces of "array-index-out-of-bounds" are seen<br>
> <br>
> Expected Behavior:<br>
> OS should boot without this Call Trace<br>
> <br>
> [Fix]<br>
> <br>
> [PATCH v3 0/6] Replace one-element arrays with flexible-array members<br>
> <a href="https://lore.kernel.org/linux-hardening/cover.1660592640.git.gustavoars@kernel.org/" rel="noreferrer" target="_blank">https://lore.kernel.org/linux-hardening/cover.1660592640.git.gustavoars@kernel.org/</a><br>
> <br>
> 48658213 scsi: megaraid_sas: Use struct_size() in code related to struct MR_PD_CFG_SEQ_NUM_SYNC<br>
> 41e83026 scsi: megaraid_sas: Use struct_size() in code related to struct MR_FW_RAID_MAP<br>
> ee92366a scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_PD_CFG_SEQ_NUM_SYNC<br>
> eeb3bab7 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_DRV_RAID_MAP<br>
> 204a29a1 scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP_DYNAMIC<br>
> ac23b92b scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP<br>
> <br>
> [Test Plan]<br>
> <br>
> 1. Connect PERC H355 controller to the system<br>
> 2. Create RAID1 using drives connected to PERC Controller<br>
> 3. Install Ubuntu 22.04.1 on VD<br>
> 4. Boot into OS after installation<br>
> OS should boot without the Call Trace listed in the Impact field<br>
> <br>
> [Where problems could occur]<br>
> <br>
> [Other Info]<br>
> <a href="https://code.launchpad.net/~mreed8855/ubuntu/+source/linux/+git/jammy/+ref/array_bounds_lp_2008157" rel="noreferrer" target="_blank">https://code.launchpad.net/~mreed8855/ubuntu/+source/linux/+git/jammy/+ref/array_bounds_lp_2008157</a><br>
> <br>
> The following changes since commit 7a9737edb25096642bcb448bd2e0c64b7f717aa4:<br>
> <br>
>    UBUNTU: Ubuntu-5.15.0-59.65 (2023-01-06 08:11:23 -0800)<br>
> <br>
> are available in the Git repository at:<br>
> <br>
>    <a href="https://code.launchpad.net/~mreed8855/ubuntu/+source/linux/+git/jammy/+ref/array_bounds_lp_2008157" rel="noreferrer" target="_blank">https://code.launchpad.net/~mreed8855/ubuntu/+source/linux/+git/jammy/+ref/array_bounds_lp_2008157</a><br>
> <br>
> for you to fetch changes up to aeee88c7297067665bdf76adb58565ec0a1eee68:<br>
> <br>
>    scsi: megaraid_sas: Use struct_size() in code related to struct MR_PD_CFG_SEQ_NUM_SYNC (2023-02-22 21:15:30 -0600)<br>
> <br>
> ----------------------------------------------------------------<br>
> Gustavo A. R. Silva (6):<br>
>        scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP<br>
>        scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_FW_RAID_MAP_DYNAMIC<br>
>        scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_DRV_RAID_MAP<br>
>        scsi: megaraid_sas: Replace one-element array with flexible-array member in MR_PD_CFG_SEQ_NUM_SYNC<br>
>        scsi: megaraid_sas: Use struct_size() in code related to struct MR_FW_RAID_MAP<br>
>        scsi: megaraid_sas: Use struct_size() in code related to struct MR_PD_CFG_SEQ_NUM_SYNC<br>
> <br>
>   drivers/scsi/megaraid/megaraid_sas_base.c   | 20 ++++++++++----------<br>
>   drivers/scsi/megaraid/megaraid_sas_fp.c     |  6 +++---<br>
>   drivers/scsi/megaraid/megaraid_sas_fusion.c |  2 +-<br>
>   drivers/scsi/megaraid/megaraid_sas_fusion.h | 12 ++++++------<br>
>   4 files changed, 20 insertions(+), 20 deletions(-)<br>
> <br>
Acked-by: Tim Gardner <<a href="mailto:tim.gardner@canonical.com" target="_blank">tim.gardner@canonical.com</a>><br>
<br>
Your pull request URL is a little weird, but I figured it out.<br>
<br>
-- <br>
-----------<br>
Tim Gardner<br>
Canonical, Inc<br>
<br>
</blockquote></div>