I have covered the required testing and found no critical issues except the below minor issues.
[Wed Dec 13 22:05:56 2023] memcpy: detected field-spanning write (size 128) of single field "bsg_reply_buf->reply_buf" at drivers/scsi/mpi3mr/mpi3mr_app.c:1658 (size 1)
[Wed Dec 13 22:05:56 2023] WARNING: CPU: 4 PID: 3587 at drivers/scsi/mpi3mr/mpi3mr_app.c:1658 mpi3mr_bsg_process_mpt_cmds+0x1302/0x14c0 [mpi3mr]
[Wed Dec 13 22:05:56 2023] Modules linked in: mpi3mr tls intel_rapl_msr intel_rapl_common kvm_amd ccp kvm binfmt_misc irqbypass crct10dif_pclmul polyval_clmulni polyval_generic ghash_clmulni_intel aesni_intel crypto_simd cryptd nls_iso8859_1 input_leds serio_raw joydev bochs drm_vram_helper drm_ttm_helper ttm mac_hid drm_kms_helper qemu_fw_cfg sch_fq_codel msr parport_pc ppdev lp parport drm efi_pstore ip_tables x_tables autofs4 ses enclosure hid_generic usbhid hid crc32_pclmul i2c_i801 ahci psmouse i2c_smbus libahci lpc_ich scsi_transport_sas virtio_rng xhci_pci xhci_pci_renesas [last unloaded: mpi3mr]
[Wed Dec 13 22:05:56 2023] CPU: 4 PID: 3587 Comm: kworker/4:2H Tainted: G W OE 6.5.0-14-generic #14
[Wed Dec 13 22:05:56 2023] Hardware name: Red Hat KVM/RHEL, BIOS 1.16.1-1.el9 04/01/2014
[Wed Dec 13 22:05:56 2023] Workqueue: kblockd blk_mq_run_work_fn
[Wed Dec 13 22:05:56 2023] RIP: 0010:mpi3mr_bsg_process_mpt_cmds+0x1302/0x14c0 [mpi3mr]
[Wed Dec 13 22:05:56 2023] Code: b9 01 00 00 00 48 89 c6 4c 89 55 90 48 c7 c2 58 2f 2a c0 48 c7 c7 a8 2f 2a c0 48 89 45 98 c6 05 4e a8 00 00 01 e8 8e d1 a6 c6 <0f> 0b 4c 8b 55 90 48 8b 45 98 e9 3b ff ff ff 31 db e9 a4 fd ff ff
[Wed Dec 13 22:05:56 2023] RSP: 0018:ffffacd300243c38 EFLAGS: 00010246
[Wed Dec 13 22:05:56 2023] RAX: 0000000000000000 RBX: ffff9190d4fe7540 RCX: 0000000000000000
[Wed Dec 13 22:05:56 2023] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[Wed Dec 13 22:05:56 2023] RBP: ffffacd300243cf8 R08: 0000000000000000 R09: 0000000000000000
[Wed Dec 13 22:05:56 2023] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9191c6ba9100
[Wed Dec 13 22:05:56 2023] R13: ffff9191c3fb8830 R14: ffff9190d4fe7000 R15: 0000000000000000
[Wed Dec 13 22:05:56 2023] FS: 0000000000000000(0000) GS:ffff91923bd00000(0000) knlGS:0000000000000000
[Wed Dec 13 22:05:56 2023] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Wed Dec 13 22:05:56 2023] CR2: 000000000213ecf8 CR3: 000000000a04a000 CR4: 0000000000350ee0
[Wed Dec 13 22:05:56 2023] Call Trace:
[Wed Dec 13 22:05:56 2023] <TASK>
[Wed Dec 13 22:05:56 2023] ? show_regs+0x6d/0x80
[Wed Dec 13 22:05:56 2023] ? __warn+0x89/0x160
[Wed Dec 13 22:05:56 2023] ? mpi3mr_bsg_process_mpt_cmds+0x1302/0x14c0 [mpi3mr]
[Wed Dec 13 22:05:56 2023] ? report_bug+0x17e/0x1b0
[Wed Dec 13 22:05:56 2023] ? handle_bug+0x51/0xa0
[Wed Dec 13 22:05:56 2023] ? exc_invalid_op+0x18/0x80
[Wed Dec 13 22:05:56 2023] ? asm_exc_invalid_op+0x1b/0x20
[Wed Dec 13 22:05:56 2023] ? mpi3mr_bsg_process_mpt_cmds+0x1302/0x14c0 [mpi3mr]
[Wed Dec 13 22:05:56 2023] ? mpi3mr_bsg_process_mpt_cmds+0x1302/0x14c0 [mpi3mr]
[Wed Dec 13 22:05:56 2023] mpi3mr_bsg_request+0x23/0x70 [mpi3mr]
[Wed Dec 13 22:05:56 2023] bsg_queue_rq+0xac/0x100
[Wed Dec 13 22:05:56 2023] blk_mq_dispatch_rq_list+0x153/0x550
[Wed Dec 13 22:05:56 2023] __blk_mq_sched_dispatch_requests+0xa4/0x190
[Wed Dec 13 22:05:56 2023] ? finish_task_switch.isra.0+0x89/0x2b0
[Wed Dec 13 22:05:56 2023] blk_mq_sched_dispatch_requests+0x37/0x80
[Wed Dec 13 22:05:56 2023] blk_mq_run_work_fn+0x3f/0x90
[Wed Dec 13 22:05:56 2023] process_one_work+0x223/0x440
[Wed Dec 13 22:05:56 2023] worker_thread+0x4d/0x3f0
[Wed Dec 13 22:05:56 2023] ? srso_untrain_ret+0x2/0x2
[Wed Dec 13 22:05:56 2023] ? __pfx_worker_thread+0x10/0x10
[Wed Dec 13 22:05:56 2023] kthread+0xf2/0x120
[Wed Dec 13 22:05:56 2023] ? __pfx_kthread+0x10/0x10
[Wed Dec 13 22:05:56 2023] ret_from_fork+0x47/0x70
[Wed Dec 13 22:05:56 2023] ? __pfx_kthread+0x10/0x10
[Wed Dec 13 22:05:56 2023] ret_from_fork_asm+0x1b/0x30
[Wed Dec 13 22:05:56 2023] </TASK>
[Wed Dec 13 22:05:56 2023] ---[ end trace 0000000000000000 ]---
- The above warning will appear only once after the driver load and it will not appear for subsequent
management commands
- The rep_buf is a flexible array which can grow in run time and whose memory is already allocated and
it will never grow beyond the allocated memory.
- This is a false positive (maybe UBSAN is responsible for throwing this warning)
Hi Jeff,
I have covered the required testing and found no critical issues except the below minor issues.
[Wed Dec 13 22:05:56 2023] memcpy: detected field-spanning write (size 128) of single field "bsg_reply_ buf->reply_ buf" at drivers/ scsi/mpi3mr/ mpi3mr_ app.c:1658 (size 1) scsi/mpi3mr/ mpi3mr_ app.c:1658 mpi3mr_ bsg_process_ mpt_cmds+ 0x1302/ 0x14c0 [mpi3mr] bsg_process_ mpt_cmds+ 0x1302/ 0x14c0 [mpi3mr] 243c38 EFLAGS: 00010246 0(0000) GS:ffff91923bd0 0000(0000) knlGS:000000000 0000000 bsg_process_ mpt_cmds+ 0x1302/ 0x14c0 [mpi3mr] bug+0x17e/ 0x1b0 bug+0x51/ 0xa0 op+0x18/ 0x80 invalid_ op+0x1b/ 0x20 bsg_process_ mpt_cmds+ 0x1302/ 0x14c0 [mpi3mr] bsg_process_ mpt_cmds+ 0x1302/ 0x14c0 [mpi3mr] bsg_request+ 0x23/0x70 [mpi3mr] rq+0xac/ 0x100 dispatch_ rq_list+ 0x153/0x550 sched_dispatch_ requests+ 0xa4/0x190 task_switch. isra.0+ 0x89/0x2b0 sched_dispatch_ requests+ 0x37/0x80 run_work_ fn+0x3f/ 0x90 one_work+ 0x223/0x440 thread+ 0x4d/0x3f0 ret+0x2/ 0x2 thread+ 0x10/0x10 0x10/0x10 fork+0x47/ 0x70 0x10/0x10 fork_asm+ 0x1b/0x30
[Wed Dec 13 22:05:56 2023] WARNING: CPU: 4 PID: 3587 at drivers/
[Wed Dec 13 22:05:56 2023] Modules linked in: mpi3mr tls intel_rapl_msr intel_rapl_common kvm_amd ccp kvm binfmt_misc irqbypass crct10dif_pclmul polyval_clmulni polyval_generic ghash_clmulni_intel aesni_intel crypto_simd cryptd nls_iso8859_1 input_leds serio_raw joydev bochs drm_vram_helper drm_ttm_helper ttm mac_hid drm_kms_helper qemu_fw_cfg sch_fq_codel msr parport_pc ppdev lp parport drm efi_pstore ip_tables x_tables autofs4 ses enclosure hid_generic usbhid hid crc32_pclmul i2c_i801 ahci psmouse i2c_smbus libahci lpc_ich scsi_transport_sas virtio_rng xhci_pci xhci_pci_renesas [last unloaded: mpi3mr]
[Wed Dec 13 22:05:56 2023] CPU: 4 PID: 3587 Comm: kworker/4:2H Tainted: G W OE 6.5.0-14-generic #14
[Wed Dec 13 22:05:56 2023] Hardware name: Red Hat KVM/RHEL, BIOS 1.16.1-1.el9 04/01/2014
[Wed Dec 13 22:05:56 2023] Workqueue: kblockd blk_mq_run_work_fn
[Wed Dec 13 22:05:56 2023] RIP: 0010:mpi3mr_
[Wed Dec 13 22:05:56 2023] Code: b9 01 00 00 00 48 89 c6 4c 89 55 90 48 c7 c2 58 2f 2a c0 48 c7 c7 a8 2f 2a c0 48 89 45 98 c6 05 4e a8 00 00 01 e8 8e d1 a6 c6 <0f> 0b 4c 8b 55 90 48 8b 45 98 e9 3b ff ff ff 31 db e9 a4 fd ff ff
[Wed Dec 13 22:05:56 2023] RSP: 0018:ffffacd300
[Wed Dec 13 22:05:56 2023] RAX: 0000000000000000 RBX: ffff9190d4fe7540 RCX: 0000000000000000
[Wed Dec 13 22:05:56 2023] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[Wed Dec 13 22:05:56 2023] RBP: ffffacd300243cf8 R08: 0000000000000000 R09: 0000000000000000
[Wed Dec 13 22:05:56 2023] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9191c6ba9100
[Wed Dec 13 22:05:56 2023] R13: ffff9191c3fb8830 R14: ffff9190d4fe7000 R15: 0000000000000000
[Wed Dec 13 22:05:56 2023] FS: 000000000000000
[Wed Dec 13 22:05:56 2023] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Wed Dec 13 22:05:56 2023] CR2: 000000000213ecf8 CR3: 000000000a04a000 CR4: 0000000000350ee0
[Wed Dec 13 22:05:56 2023] Call Trace:
[Wed Dec 13 22:05:56 2023] <TASK>
[Wed Dec 13 22:05:56 2023] ? show_regs+0x6d/0x80
[Wed Dec 13 22:05:56 2023] ? __warn+0x89/0x160
[Wed Dec 13 22:05:56 2023] ? mpi3mr_
[Wed Dec 13 22:05:56 2023] ? report_
[Wed Dec 13 22:05:56 2023] ? handle_
[Wed Dec 13 22:05:56 2023] ? exc_invalid_
[Wed Dec 13 22:05:56 2023] ? asm_exc_
[Wed Dec 13 22:05:56 2023] ? mpi3mr_
[Wed Dec 13 22:05:56 2023] ? mpi3mr_
[Wed Dec 13 22:05:56 2023] mpi3mr_
[Wed Dec 13 22:05:56 2023] bsg_queue_
[Wed Dec 13 22:05:56 2023] blk_mq_
[Wed Dec 13 22:05:56 2023] __blk_mq_
[Wed Dec 13 22:05:56 2023] ? finish_
[Wed Dec 13 22:05:56 2023] blk_mq_
[Wed Dec 13 22:05:56 2023] blk_mq_
[Wed Dec 13 22:05:56 2023] process_
[Wed Dec 13 22:05:56 2023] worker_
[Wed Dec 13 22:05:56 2023] ? srso_untrain_
[Wed Dec 13 22:05:56 2023] ? __pfx_worker_
[Wed Dec 13 22:05:56 2023] kthread+0xf2/0x120
[Wed Dec 13 22:05:56 2023] ? __pfx_kthread+
[Wed Dec 13 22:05:56 2023] ret_from_
[Wed Dec 13 22:05:56 2023] ? __pfx_kthread+
[Wed Dec 13 22:05:56 2023] ret_from_
[Wed Dec 13 22:05:56 2023] </TASK>
[Wed Dec 13 22:05:56 2023] ---[ end trace 0000000000000000 ]---
- The above warning will appear only once after the driver load and it will not appear for subsequent
management commands
- The rep_buf is a flexible array which can grow in run time and whose memory is already allocated and
it will never grow beyond the allocated memory.
- This is a false positive (maybe UBSAN is responsible for throwing this warning)