| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/15 06:50 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies the Marvell UMI (mvumi) SCSI host controller driver (drivers/scsi/mvumi.c and drivers/scsi/mvumi.h). This driver is for specific Marvell storage controllers (MV9143 and MV9580) that require physical PCIe hardware not emulated in standard QEMU or GCE virtualized environments. Consequently, the modified code cannot be probed or executed in syzkaller fuzzing environments and is structurally unreachable.",
"WorthFuzzing": false
} |
| 1/1 | 2026/10/15 06:50 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 2c7ed78d12ded532e85a48098abb65553559b9cd\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Oct 15 06:50:42 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c\nindex e70d336b4ab39..a2759dbeedf75 100644\n--- a/drivers/scsi/mvumi.c\n+++ b/drivers/scsi/mvumi.c\n@@ -238,6 +238,8 @@ static int mvumi_internal_cmd_sgl(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,\n \tm_sg = (struct mvumi_sgl *) \u0026cmd-\u003eframe-\u003epayload[0];\n \tcmd-\u003eframe-\u003esg_counts = 1;\n \tcmd-\u003edata_buf = virt_addr;\n+\tcmd-\u003edata_buf_phys = phy_addr;\n+\tcmd-\u003edata_buf_size = size;\n \n \tm_sg-\u003ebaseaddr_l = cpu_to_le32(lower_32_bits(phy_addr));\n \tm_sg-\u003ebaseaddr_h = cpu_to_le32(upper_32_bits(phy_addr));\n@@ -286,21 +288,10 @@ static struct mvumi_cmd *mvumi_create_internal_cmd(struct mvumi_hba *mhba,\n static void mvumi_delete_internal_cmd(struct mvumi_hba *mhba,\n \t\t\t\t\t\tstruct mvumi_cmd *cmd)\n {\n-\tstruct mvumi_sgl *m_sg;\n-\tunsigned int size;\n-\tdma_addr_t phy_addr;\n-\n \tif (cmd \u0026\u0026 cmd-\u003eframe) {\n-\t\tif (cmd-\u003eframe-\u003esg_counts) {\n-\t\t\tm_sg = (struct mvumi_sgl *) \u0026cmd-\u003eframe-\u003epayload[0];\n-\t\t\tsgd_getsz(mhba, m_sg, size);\n-\n-\t\t\tphy_addr = (dma_addr_t) m_sg-\u003ebaseaddr_l |\n-\t\t\t\t(dma_addr_t) ((m_sg-\u003ebaseaddr_h \u003c\u003c 16) \u003c\u003c 16);\n-\n-\t\t\tdma_free_coherent(\u0026mhba-\u003epdev-\u003edev, size, cmd-\u003edata_buf,\n-\t\t\t\t\t\t\t\tphy_addr);\n-\t\t}\n+\t\tif (cmd-\u003edata_buf)\n+\t\t\tdma_free_coherent(\u0026mhba-\u003epdev-\u003edev, cmd-\u003edata_buf_size,\n+\t\t\t\t\t cmd-\u003edata_buf, cmd-\u003edata_buf_phys);\n \t\tdma_free_coherent(\u0026mhba-\u003epdev-\u003edev, mhba-\u003eib_max_size,\n \t\t\t\tcmd-\u003eframe, cmd-\u003eframe_phys);\n \t\tkfree(cmd);\n@@ -466,9 +457,9 @@ static char mvumi_check_ob_frame(struct mvumi_hba *mhba,\n \n \tudelay(1);\n \tp_outb_frame = mhba-\u003eob_list + cur_obf * mhba-\u003eob_max_size;\n-\trequest_id = p_outb_frame-\u003erequest_id;\n-\ttag = p_outb_frame-\u003etag;\n-\tif (tag \u003e mhba-\u003etag_pool.size) {\n+\trequest_id = READ_ONCE(p_outb_frame-\u003erequest_id);\n+\ttag = READ_ONCE(p_outb_frame-\u003etag);\n+\tif (tag \u003e= mhba-\u003etag_pool.size) {\n \t\tdev_err(\u0026mhba-\u003epdev-\u003edev, \"ob frame data error\\n\");\n \t\treturn -1;\n \t}\n@@ -530,6 +521,7 @@ static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)\n \tstruct mvumi_ob_data *ob_data;\n \tstruct mvumi_rsp_frame *p_outb_frame;\n \tstruct mvumi_hw_regs *regs = mhba-\u003eregs;\n+\tunsigned short tag;\n \n \tif (mhba-\u003einstancet-\u003echeck_ob_list(mhba, \u0026cur_obf, \u0026assign_obf_end))\n \t\treturn;\n@@ -546,10 +538,11 @@ static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)\n \t\t/* Copy pointer may point to entry in outbound list\n \t\t* before entry has valid data\n \t\t*/\n-\t\tif (unlikely(p_outb_frame-\u003etag \u003e mhba-\u003etag_pool.size ||\n-\t\t\tmhba-\u003etag_cmd[p_outb_frame-\u003etag] == NULL ||\n-\t\t\tp_outb_frame-\u003erequest_id !=\n-\t\t\t\tmhba-\u003etag_cmd[p_outb_frame-\u003etag]-\u003erequest_id))\n+\t\ttag = READ_ONCE(p_outb_frame-\u003etag);\n+\t\tif (unlikely(tag \u003e= mhba-\u003etag_pool.size ||\n+\t\t\t !mhba-\u003etag_cmd[tag] ||\n+\t\t\t mhba-\u003etag_cmd[tag]-\u003erequest_id !=\n+\t\t\t READ_ONCE(p_outb_frame-\u003erequest_id)))\n \t\t\tif (mvumi_check_ob_frame(mhba, cur_obf, p_outb_frame))\n \t\t\t\tcontinue;\n \n@@ -569,7 +562,7 @@ static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)\n \t\t}\n \n \t\tmemcpy(ob_data-\u003edata, p_outb_frame, mhba-\u003eob_max_size);\n-\t\tp_outb_frame-\u003etag = 0xff;\n+\t\tp_outb_frame-\u003etag = MVUMI_TAG_CONSUMED;\n \n \t\tlist_add_tail(\u0026ob_data-\u003elist, \u0026mhba-\u003efree_ob_list);\n \t}\n@@ -912,10 +905,23 @@ static int mvumi_init_data(struct mvumi_hba *mhba)\n \tunsigned int tmp_size, offset, i;\n \tvoid *virmem, *v;\n \tdma_addr_t p;\n+\tu64 total;\n \n \tif (mhba-\u003efw_flag \u0026 MVUMI_FW_ALLOC)\n \t\treturn 0;\n \n+\t/* These are firmware-supplied and size the allocations below. */\n+\ttotal = (u64)mhba-\u003eib_max_size * mhba-\u003emax_io +\n+\t\t(u64)mhba-\u003eob_max_size * mhba-\u003emax_io +\n+\t\tsizeof(struct mvumi_dyn_list_entry) * (u64)mhba-\u003emax_io +\n+\t\t160;\n+\tif (total \u003e UINT_MAX) {\n+\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\"handshake sizes too large: io %u, in %u, out %u\\n\",\n+\t\t\tmhba-\u003emax_io, mhba-\u003eib_max_size, mhba-\u003eob_max_size);\n+\t\treturn -1;\n+\t}\n+\n \ttmp_size = mhba-\u003eib_max_size * mhba-\u003emax_io;\n \tif (mhba-\u003ehba_capability \u0026 HS_CAPABILITY_SUPPORT_DYN_SRC)\n \t\ttmp_size += sizeof(struct mvumi_dyn_list_entry) * mhba-\u003emax_io;\n@@ -1039,39 +1045,130 @@ static int mvumi_hs_process_page(struct mvumi_hba *mhba,\n {\n \tstruct mvumi_hs_page1 *hs_page1;\n \tunsigned char page_checksum;\n+\tu16 frame_length = READ_ONCE(hs_header-\u003eframe_length);\n \n-\tpage_checksum = mvumi_calculate_checksum(hs_header,\n-\t\t\t\t\t\ths_header-\u003eframe_length);\n+\tif (frame_length \u003e HSP_MAX_SIZE - sizeof(struct mvumi_hs_header)) {\n+\t\tdev_err(\u0026mhba-\u003epdev-\u003edev, \"invalid handshake frame length %d\\n\",\n+\t\t\tframe_length);\n+\t\treturn -1;\n+\t}\n+\n+\tpage_checksum = mvumi_calculate_checksum(hs_header, frame_length);\n \tif (page_checksum != hs_header-\u003echecksum) {\n \t\tdev_err(\u0026mhba-\u003epdev-\u003edev, \"checksum error\\n\");\n \t\treturn -1;\n \t}\n \n \tswitch (hs_header-\u003epage_code) {\n-\tcase HS_PAGE_FIRM_CAP:\n+\tcase HS_PAGE_FIRM_CAP: {\n+\t\tunsigned int new_max_io, new_ib_max_size, new_ob_max_size;\n+\t\tunsigned int new_list_num_io;\n+\t\tunsigned short new_max_target_id, new_capability;\n+\t\tunsigned int new_max_transfer_size;\n+\t\tu8 in_sz, out_sz, list_depth;\n+\n \t\ths_page1 = (struct mvumi_hs_page1 *) hs_header;\n \n-\t\tmhba-\u003emax_io = hs_page1-\u003emax_io_support;\n-\t\tmhba-\u003elist_num_io = hs_page1-\u003ecl_inout_list_depth;\n-\t\tmhba-\u003emax_transfer_size = hs_page1-\u003emax_transfer_size;\n-\t\tmhba-\u003emax_target_id = hs_page1-\u003emax_devices_support;\n-\t\tmhba-\u003ehba_capability = hs_page1-\u003ecapability;\n-\t\tmhba-\u003eib_max_size_setting = hs_page1-\u003ecl_in_max_entry_size;\n-\t\tmhba-\u003eib_max_size = (1 \u003c\u003c hs_page1-\u003ecl_in_max_entry_size) \u003c\u003c 2;\n+\t\t/*\n+\t\t * The page is in coherent DMA memory, so take every field\n+\t\t * out of it once: a second fetch of a value that has already\n+\t\t * been checked would not be the value that was checked.\n+\t\t */\n+\t\tin_sz = READ_ONCE(hs_page1-\u003ecl_in_max_entry_size);\n+\t\tout_sz = READ_ONCE(hs_page1-\u003ecl_out_max_entry_size);\n+\t\tlist_depth = READ_ONCE(hs_page1-\u003ecl_inout_list_depth);\n+\t\tnew_max_io = READ_ONCE(hs_page1-\u003emax_io_support);\n+\t\tnew_max_target_id = READ_ONCE(hs_page1-\u003emax_devices_support);\n+\t\tnew_capability = READ_ONCE(hs_page1-\u003ecapability);\n+\t\tnew_max_transfer_size = READ_ONCE(hs_page1-\u003emax_transfer_size);\n+\n+\t\t/* Firmware-supplied shift counts: (1U \u003c\u003c n) \u003c\u003c 2 must fit. */\n+\t\tif (in_sz \u003e 29 || out_sz \u003e 29) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"invalid handshake entry size\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tnew_ib_max_size = (1U \u003c\u003c in_sz) \u003c\u003c 2;\n+\t\tnew_ob_max_size = (1U \u003c\u003c out_sz) \u003c\u003c 2;\n \n-\t\tmhba-\u003eob_max_size_setting = hs_page1-\u003ecl_out_max_entry_size;\n-\t\tmhba-\u003eob_max_size = (1 \u003c\u003c hs_page1-\u003ecl_out_max_entry_size) \u003c\u003c 2;\n+\t\t/*\n+\t\t * A target above MVUMI_MAX_TARGET_ID cannot be addressed: its\n+\t\t * id would land in the LUN byte of device_id and alias another\n+\t\t * device. It is also what makes the loop counter in\n+\t\t * mvumi_flush_cache() wrap before it reaches the bound.\n+\t\t */\n+\t\tif (new_max_target_id \u003e MVUMI_MAX_TARGET_ID) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"too many devices reported: %u\\n\",\n+\t\t\t\tnew_max_target_id);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\t/* An entry has to hold the frame the driver puts in it. */\n+\t\tif (new_ib_max_size \u003c sizeof(struct mvumi_msg_frame) +\n+\t\t\t\t\tsizeof(struct mvumi_sgl) ||\n+\t\t new_ob_max_size \u003c sizeof(struct mvumi_rsp_frame) +\n+\t\t\t\t\tsizeof(struct mvumi_sense_data)) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"handshake entry size too small: in %u, out %u\\n\",\n+\t\t\t\tnew_ib_max_size, new_ob_max_size);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tnew_list_num_io = list_depth;\n+\t\tif (new_capability \u0026 HS_CAPABILITY_NEW_PAGE_IO_DEPTH_DEF) {\n+\t\t\tif (list_depth \u003e= 32) {\n+\t\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\t\"invalid handshake list depth\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tnew_list_num_io = 1U \u003c\u003c list_depth;\n+\t\t}\n+\t\t/* The rings hold max_io entries but the index wraps on list_num_io. */\n+\t\tif (new_list_num_io == 0 || new_list_num_io \u003e new_max_io) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"invalid handshake list depth: %u entries for %u commands\\n\",\n+\t\t\t\tnew_list_num_io, new_max_io);\n+\t\t\treturn -1;\n+\t\t}\n \n \t\tdev_dbg(\u0026mhba-\u003epdev-\u003edev, \"FW version:%d\\n\",\n-\t\t\t\t\t\ths_page1-\u003efw_ver.ver_build);\n+\t\t\t\tREAD_ONCE(hs_page1-\u003efw_ver.ver_build));\n+\n+\t\t/* A host reset does not reallocate, so the sizes have to stay\n+\t\t * the ones the buffers were allocated with. Only check that\n+\t\t * the firmware is not asking for more than they hold.\n+\t\t */\n+\t\tif (mhba-\u003efw_flag \u0026 MVUMI_FW_ALLOC) {\n+\t\t\tif (new_max_io \u003e mhba-\u003emax_io ||\n+\t\t\t new_ib_max_size \u003e mhba-\u003eib_max_size ||\n+\t\t\t new_ob_max_size \u003e mhba-\u003eob_max_size ||\n+\t\t\t new_list_num_io \u003e mhba-\u003elist_num_io ||\n+\t\t\t new_max_target_id \u003e mhba-\u003emax_target_id) {\n+\t\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\t\"handshake sizes grew across reset\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tmhba-\u003emax_io = new_max_io;\n+\t\tmhba-\u003elist_num_io = new_list_num_io;\n+\t\tmhba-\u003emax_transfer_size = new_max_transfer_size;\n+\t\tmhba-\u003emax_target_id = new_max_target_id;\n+\t\tmhba-\u003ehba_capability = new_capability;\n+\t\tmhba-\u003eib_max_size_setting = in_sz;\n+\t\tmhba-\u003eib_max_size = new_ib_max_size;\n+\t\tmhba-\u003eob_max_size_setting = out_sz;\n+\t\tmhba-\u003eob_max_size = new_ob_max_size;\n \n \t\tif (mhba-\u003ehba_capability \u0026 HS_CAPABILITY_SUPPORT_COMPACT_SG)\n \t\t\tmhba-\u003eeot_flag = 22;\n \t\telse\n \t\t\tmhba-\u003eeot_flag = 27;\n-\t\tif (mhba-\u003ehba_capability \u0026 HS_CAPABILITY_NEW_PAGE_IO_DEPTH_DEF)\n-\t\t\tmhba-\u003elist_num_io = 1 \u003c\u003c hs_page1-\u003ecl_inout_list_depth;\n \t\tbreak;\n+\t}\n \tdefault:\n \t\tdev_err(\u0026mhba-\u003epdev-\u003edev, \"handshake: page code error\\n\");\n \t\treturn -1;\n@@ -1237,7 +1334,7 @@ static unsigned char mvumi_handshake_event(struct mvumi_hba *mhba)\n \n static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)\n {\n-\tunsigned int tmp;\n+\tunsigned int tmp, steps;\n \tunsigned long before;\n \n \tbefore = jiffies;\n@@ -1258,6 +1355,7 @@ static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)\n \n \tmhba-\u003efw_state = FW_STATE_STARTING;\n \tdev_dbg(\u0026mhba-\u003epdev-\u003edev, \"start firmware handshake...\\n\");\n+\tsteps = 0;\n \tdo {\n \t\tif (mvumi_handshake_event(mhba)) {\n \t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n@@ -1265,6 +1363,12 @@ static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)\n \t\t\t\t\t\tmhba-\u003efw_state);\n \t\t\treturn -1;\n \t\t}\n+\t\tif (++steps \u003e MVUMI_HS_MAX_STEPS) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"handshake did not finish in %u steps, state 0x%x.\\n\",\n+\t\t\t\tMVUMI_HS_MAX_STEPS, mhba-\u003efw_state);\n+\t\t\treturn -1;\n+\t\t}\n \t} while (mhba-\u003efw_state != FW_STATE_STARTED);\n \n \tdev_dbg(\u0026mhba-\u003epdev-\u003edev, \"firmware handshake done\\n\");\n@@ -1361,7 +1465,8 @@ static void mvumi_show_event(struct mvumi_hba *mhba,\n \tif (ptr-\u003eparam_count) {\n \t\tprintk(KERN_WARNING \"Event param(len 0x%x): \",\n \t\t\t\t\t\tptr-\u003eparam_count);\n-\t\tfor (i = 0; i \u003c ptr-\u003eparam_count; i++)\n+\t\tfor (i = 0; i \u003c ptr-\u003eparam_count \u0026\u0026\n+\t\t i \u003c ARRAY_SIZE(ptr-\u003eparams); i++)\n \t\t\tprintk(KERN_WARNING \"0x%x \", ptr-\u003eparams[i]);\n \n \t\tprintk(KERN_WARNING \"\\n\");\n@@ -1370,7 +1475,8 @@ static void mvumi_show_event(struct mvumi_hba *mhba,\n \tif (ptr-\u003esense_data_length) {\n \t\tprintk(KERN_WARNING \"Event sense data(len 0x%x): \",\n \t\t\t\t\t\tptr-\u003esense_data_length);\n-\t\tfor (i = 0; i \u003c ptr-\u003esense_data_length; i++)\n+\t\tfor (i = 0; i \u003c ptr-\u003esense_data_length \u0026\u0026\n+\t\t i \u003c sizeof(ptr-\u003esense_data); i++)\n \t\t\tprintk(KERN_WARNING \"0x%x \", ptr-\u003esense_data[i]);\n \t\tprintk(KERN_WARNING \"\\n\");\n \t}\n@@ -1644,31 +1750,38 @@ static int mvumi_rescan_bus(void *data)\n static void mvumi_proc_msg(struct mvumi_hba *mhba,\n \t\t\t\t\tstruct mvumi_hotplug_event *param)\n {\n-\tu16 size = param-\u003esize;\n-\tconst unsigned long *ar_bitmap;\n-\tconst unsigned long *re_bitmap;\n+\tu16 size = READ_ONCE(param-\u003esize);\n+\tconst u8 *ar_bitmap;\n+\tconst u8 *re_bitmap;\n \tint index;\n \n+\t/*\n+\t * The second bitmap starts size bits into the event buffer, so that\n+\t * is the furthest the two walks reach. Bound it by the length the\n+\t * firmware was told it may write, not by the buffer: the bytes past\n+\t * that are still zero, and a zero bit here means a device is present.\n+\t */\n+\tif (sizeof(*param) + (size \u003e\u003e 3) + BITS_TO_LONGS(size) * sizeof(long) \u003e\n+\t\t\tsizeof(struct mvumi_event_req)) {\n+\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\"invalid hotplug event bitmap size %u\\n\", size);\n+\t\treturn;\n+\t}\n+\n \tif (mhba-\u003efw_flag \u0026 MVUMI_FW_ATTACH) {\n-\t\tindex = -1;\n-\t\tar_bitmap = (const unsigned long *) param-\u003ebitmap;\n-\t\tre_bitmap = (const unsigned long *) \u0026param-\u003ebitmap[size \u003e\u003e 3];\n+\t\tar_bitmap = param-\u003ebitmap;\n+\t\tre_bitmap = \u0026param-\u003ebitmap[size \u003e\u003e 3];\n \n \t\tmutex_lock(\u0026mhba-\u003esas_discovery_mutex);\n-\t\tdo {\n-\t\t\tindex = find_next_zero_bit(ar_bitmap, size, index + 1);\n-\t\t\tif (index \u003e= size)\n-\t\t\t\tbreak;\n-\t\t\tmvumi_handle_hotplug(mhba, index, DEVICE_ONLINE);\n-\t\t} while (1);\n-\n-\t\tindex = -1;\n-\t\tdo {\n-\t\t\tindex = find_next_zero_bit(re_bitmap, size, index + 1);\n-\t\t\tif (index \u003e= size)\n-\t\t\t\tbreak;\n-\t\t\tmvumi_handle_hotplug(mhba, index, DEVICE_OFFLINE);\n-\t\t} while (1);\n+\t\tfor (index = 0; index \u003c size; index++)\n+\t\t\tif (!(ar_bitmap[index \u003e\u003e 3] \u0026 (1 \u003c\u003c (index \u0026 7))))\n+\t\t\t\tmvumi_handle_hotplug(mhba, index,\n+\t\t\t\t\t\t DEVICE_ONLINE);\n+\n+\t\tfor (index = 0; index \u003c size; index++)\n+\t\t\tif (!(re_bitmap[index \u003e\u003e 3] \u0026 (1 \u003c\u003c (index \u0026 7))))\n+\t\t\t\tmvumi_handle_hotplug(mhba, index,\n+\t\t\t\t\t\t DEVICE_OFFLINE);\n \t\tmutex_unlock(\u0026mhba-\u003esas_discovery_mutex);\n \t}\n }\n@@ -1700,7 +1813,7 @@ static int mvumi_get_event(struct mvumi_hba *mhba, unsigned char msg)\n \tstruct mvumi_cmd *cmd;\n \tstruct mvumi_msg_frame *frame;\n \n-\tcmd = mvumi_create_internal_cmd(mhba, 512);\n+\tcmd = mvumi_create_internal_cmd(mhba, MVUMI_EVENT_BUF_SIZE);\n \tif (!cmd)\n \t\treturn -1;\n \tcmd-\u003escmd = NULL;\n@@ -1765,6 +1878,7 @@ static void mvumi_handle_clob(struct mvumi_hba *mhba)\n \tstruct mvumi_rsp_frame *ob_frame;\n \tstruct mvumi_cmd *cmd;\n \tstruct mvumi_ob_data *pool;\n+\tunsigned short tag;\n \n \twhile (!list_empty(\u0026mhba-\u003efree_ob_list)) {\n \t\tpool = list_first_entry(\u0026mhba-\u003efree_ob_list,\n@@ -1773,11 +1887,33 @@ static void mvumi_handle_clob(struct mvumi_hba *mhba)\n \t\tlist_add_tail(\u0026pool-\u003elist, \u0026mhba-\u003eob_data_list);\n \n \t\tob_frame = (struct mvumi_rsp_frame *) \u0026pool-\u003edata[0];\n-\t\tcmd = mhba-\u003etag_cmd[ob_frame-\u003etag];\n+\t\t/*\n+\t\t * The tag was checked against the frame in the outbound list.\n+\t\t * This is the copy, so check the value that is used.\n+\t\t */\n+\t\ttag = ob_frame-\u003etag;\n+\t\tif (tag \u003e= mhba-\u003etag_pool.size) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"ob frame tag[0x%x] out of range\\n\", tag);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tcmd = mhba-\u003etag_cmd[tag];\n+\t\tif (!cmd) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"ob frame tag[0x%x] with no command\\n\", tag);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (mhba-\u003erequest_id_enabled \u0026\u0026\n+\t\t ob_frame-\u003erequest_id != cmd-\u003erequest_id) {\n+\t\t\tdev_err(\u0026mhba-\u003epdev-\u003edev,\n+\t\t\t\t\"ob frame tag[0x%x] request ID 0x%x != 0x%x\\n\",\n+\t\t\t\ttag, ob_frame-\u003erequest_id, cmd-\u003erequest_id);\n+\t\t\tcontinue;\n+\t\t}\n \n \t\tatomic_dec(\u0026mhba-\u003efw_outstanding);\n-\t\tmhba-\u003etag_cmd[ob_frame-\u003etag] = NULL;\n-\t\ttag_release_one(mhba, \u0026mhba-\u003etag_pool, ob_frame-\u003etag);\n+\t\tmhba-\u003etag_cmd[tag] = NULL;\n+\t\ttag_release_one(mhba, \u0026mhba-\u003etag_pool, tag);\n \t\tif (cmd-\u003escmd)\n \t\t\tmvumi_complete_cmd(mhba, cmd, ob_frame);\n \t\telse\ndiff --git a/drivers/scsi/mvumi.h b/drivers/scsi/mvumi.h\nindex 1306a4abf19ad..9597e87a08167 100644\n--- a/drivers/scsi/mvumi.h\n+++ b/drivers/scsi/mvumi.h\n@@ -124,6 +124,21 @@ enum {\n #define APICDB1_HOST_GETEVENT\t\t1\n #define MAX_EVENTS_RETURNED\t\t6\n \n+/* size of the buffer the driver hands the firmware for event replies */\n+#define MVUMI_EVENT_BUF_SIZE\t\t512\n+\n+/*\n+ * mvumi_build_frame() packs the target id into the low byte of device_id\n+ * and the LUN into the high byte, so only these ids can be addressed.\n+ */\n+#define MVUMI_MAX_TARGET_ID\t\t255\n+\n+/*\n+ * Stamped into a consumed outbound list entry. A valid tag is below\n+ * tag_pool.size, which is a u16, so the largest u16 is never one.\n+ */\n+#define MVUMI_TAG_CONSUMED\t\t0xffff\n+\n #define DEVICE_OFFLINE\t0\n #define DEVICE_ONLINE\t1\n \n@@ -180,20 +195,10 @@ struct mvumi_compact_sgl {\n \tu32\tflags;\n };\n \n-#define GET_COMPACT_SGD_SIZE(sgd)\t\\\n-\t((((struct mvumi_compact_sgl *)(sgd))-\u003eflags) \u0026 0x3FFFFFL)\n-\n #define SET_COMPACT_SGD_SIZE(sgd, sz) do {\t\t\t\\\n \t(((struct mvumi_compact_sgl *)(sgd))-\u003eflags) \u0026= ~0x3FFFFFL;\t\\\n \t(((struct mvumi_compact_sgl *)(sgd))-\u003eflags) |= (sz);\t\t\\\n } while (0)\n-#define sgd_getsz(_mhba, sgd, sz) do {\t\t\t\t\\\n-\tif (_mhba-\u003ehba_capability \u0026 HS_CAPABILITY_SUPPORT_COMPACT_SG)\t\\\n-\t\t(sz) = GET_COMPACT_SGD_SIZE(sgd);\t\\\n-\telse \\\n-\t\t(sz) = (sgd)-\u003esize;\t\t\t\\\n-} while (0)\n-\n #define sgd_setsz(_mhba, sgd, sz) do {\t\t\t\t\\\n \tif (_mhba-\u003ehba_capability \u0026 HS_CAPABILITY_SUPPORT_COMPACT_SG)\t\\\n \t\tSET_COMPACT_SGD_SIZE(sgd, sz);\t\t\\\n@@ -250,6 +255,8 @@ struct mvumi_cmd {\n \tstruct scsi_cmnd *scmd;\n \tatomic_t sync_cmd;\n \tvoid *data_buf;\n+\tdma_addr_t data_buf_phys;\n+\tunsigned int data_buf_size;\n \tunsigned short request_id;\n \tunsigned char cmd_status;\n };\n@@ -392,6 +399,15 @@ struct mvumi_hs_header {\n #define HS_PAGE_CL_INFO\t\t0x4\n #define HS_PAGE_TOTAL\t\t0x5\n \n+/*\n+ * Each mvumi_handshake() call advances the state machine by one step: four\n+ * fixed steps, plus one per page the firmware asks for in the u8 total_pages,\n+ * plus a restart if it ever reports a status other than HS_STATUS_OK. This\n+ * caps how many steps the driver will take before giving up, so that a\n+ * firmware that keeps the handshake going cannot keep it going forever.\n+ */\n+#define MVUMI_HS_MAX_STEPS\t1024\n+\n #define HSP_SIZE(i)\tsizeof(struct mvumi_hs_page##i)\n \n #define HSP_MAX_SIZE ({\t\t\t\t\t\\\n"
} |
| 2/1 | 2026/10/15 06:50 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the Marvell UMI (mvumi) SCSI host controller driver (drivers/scsi/mvumi.c and drivers/scsi/mvumi.h). This driver is for specific Marvell storage controllers (MV9143 and MV9580) that require physical PCIe hardware not emulated in standard QEMU or GCE virtualized environments. Consequently, the modified code cannot be probed or executed in syzkaller fuzzing environments and is structurally unreachable.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 2c7ed78d12ded532e85a48098abb65553559b9cd
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Oct 15 06:50:42 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index e70d336b4ab39..a2759dbeedf75 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -238,6 +238,8 @@ static int mvumi_internal_cmd_sgl(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
m_sg = (struct mvumi_sgl *) &cmd->frame->payload[0];
cmd->frame->sg_counts = 1;
cmd->data_buf = virt_addr;
+ cmd->data_buf_phys = phy_addr;
+ cmd->data_buf_size = size;
m_sg->baseaddr_l = cpu_to_le32(lower_32_bits(phy_addr));
m_sg->baseaddr_h = cpu_to_le32(upper_32_bits(phy_addr));
@@ -286,21 +288,10 @@ static struct mvumi_cmd *mvumi_create_internal_cmd(struct mvumi_hba *mhba,
static void mvumi_delete_internal_cmd(struct mvumi_hba *mhba,
struct mvumi_cmd *cmd)
{
- struct mvumi_sgl *m_sg;
- unsigned int size;
- dma_addr_t phy_addr;
-
if (cmd && cmd->frame) {
- if (cmd->frame->sg_counts) {
- m_sg = (struct mvumi_sgl *) &cmd->frame->payload[0];
- sgd_getsz(mhba, m_sg, size);
-
- phy_addr = (dma_addr_t) m_sg->baseaddr_l |
- (dma_addr_t) ((m_sg->baseaddr_h << 16) << 16);
-
- dma_free_coherent(&mhba->pdev->dev, size, cmd->data_buf,
- phy_addr);
- }
+ if (cmd->data_buf)
+ dma_free_coherent(&mhba->pdev->dev, cmd->data_buf_size,
+ cmd->data_buf, cmd->data_buf_phys);
dma_free_coherent(&mhba->pdev->dev, mhba->ib_max_size,
cmd->frame, cmd->frame_phys);
kfree(cmd);
@@ -466,9 +457,9 @@ static char mvumi_check_ob_frame(struct mvumi_hba *mhba,
udelay(1);
p_outb_frame = mhba->ob_list + cur_obf * mhba->ob_max_size;
- request_id = p_outb_frame->request_id;
- tag = p_outb_frame->tag;
- if (tag > mhba->tag_pool.size) {
+ request_id = READ_ONCE(p_outb_frame->request_id);
+ tag = READ_ONCE(p_outb_frame->tag);
+ if (tag >= mhba->tag_pool.size) {
dev_err(&mhba->pdev->dev, "ob frame data error\n");
return -1;
}
@@ -530,6 +521,7 @@ static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)
struct mvumi_ob_data *ob_data;
struct mvumi_rsp_frame *p_outb_frame;
struct mvumi_hw_regs *regs = mhba->regs;
+ unsigned short tag;
if (mhba->instancet->check_ob_list(mhba, &cur_obf, &assign_obf_end))
return;
@@ -546,10 +538,11 @@ static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)
/* Copy pointer may point to entry in outbound list
* before entry has valid data
*/
- if (unlikely(p_outb_frame->tag > mhba->tag_pool.size ||
- mhba->tag_cmd[p_outb_frame->tag] == NULL ||
- p_outb_frame->request_id !=
- mhba->tag_cmd[p_outb_frame->tag]->request_id))
+ tag = READ_ONCE(p_outb_frame->tag);
+ if (unlikely(tag >= mhba->tag_pool.size ||
+ !mhba->tag_cmd[tag] ||
+ mhba->tag_cmd[tag]->request_id !=
+ READ_ONCE(p_outb_frame->request_id)))
if (mvumi_check_ob_frame(mhba, cur_obf, p_outb_frame))
continue;
@@ -569,7 +562,7 @@ static void mvumi_receive_ob_list_entry(struct mvumi_hba *mhba)
}
memcpy(ob_data->data, p_outb_frame, mhba->ob_max_size);
- p_outb_frame->tag = 0xff;
+ p_outb_frame->tag = MVUMI_TAG_CONSUMED;
list_add_tail(&ob_data->list, &mhba->free_ob_list);
}
@@ -912,10 +905,23 @@ static int mvumi_init_data(struct mvumi_hba *mhba)
unsigned int tmp_size, offset, i;
void *virmem, *v;
dma_addr_t p;
+ u64 total;
if (mhba->fw_flag & MVUMI_FW_ALLOC)
return 0;
+ /* These are firmware-supplied and size the allocations below. */
+ total = (u64)mhba->ib_max_size * mhba->max_io +
+ (u64)mhba->ob_max_size * mhba->max_io +
+ sizeof(struct mvumi_dyn_list_entry) * (u64)mhba->max_io +
+ 160;
+ if (total > UINT_MAX) {
+ dev_err(&mhba->pdev->dev,
+ "handshake sizes too large: io %u, in %u, out %u\n",
+ mhba->max_io, mhba->ib_max_size, mhba->ob_max_size);
+ return -1;
+ }
+
tmp_size = mhba->ib_max_size * mhba->max_io;
if (mhba->hba_capability & HS_CAPABILITY_SUPPORT_DYN_SRC)
tmp_size += sizeof(struct mvumi_dyn_list_entry) * mhba->max_io;
@@ -1039,39 +1045,130 @@ static int mvumi_hs_process_page(struct mvumi_hba *mhba,
{
struct mvumi_hs_page1 *hs_page1;
unsigned char page_checksum;
+ u16 frame_length = READ_ONCE(hs_header->frame_length);
- page_checksum = mvumi_calculate_checksum(hs_header,
- hs_header->frame_length);
+ if (frame_length > HSP_MAX_SIZE - sizeof(struct mvumi_hs_header)) {
+ dev_err(&mhba->pdev->dev, "invalid handshake frame length %d\n",
+ frame_length);
+ return -1;
+ }
+
+ page_checksum = mvumi_calculate_checksum(hs_header, frame_length);
if (page_checksum != hs_header->checksum) {
dev_err(&mhba->pdev->dev, "checksum error\n");
return -1;
}
switch (hs_header->page_code) {
- case HS_PAGE_FIRM_CAP:
+ case HS_PAGE_FIRM_CAP: {
+ unsigned int new_max_io, new_ib_max_size, new_ob_max_size;
+ unsigned int new_list_num_io;
+ unsigned short new_max_target_id, new_capability;
+ unsigned int new_max_transfer_size;
+ u8 in_sz, out_sz, list_depth;
+
hs_page1 = (struct mvumi_hs_page1 *) hs_header;
- mhba->max_io = hs_page1->max_io_support;
- mhba->list_num_io = hs_page1->cl_inout_list_depth;
- mhba->max_transfer_size = hs_page1->max_transfer_size;
- mhba->max_target_id = hs_page1->max_devices_support;
- mhba->hba_capability = hs_page1->capability;
- mhba->ib_max_size_setting = hs_page1->cl_in_max_entry_size;
- mhba->ib_max_size = (1 << hs_page1->cl_in_max_entry_size) << 2;
+ /*
+ * The page is in coherent DMA memory, so take every field
+ * out of it once: a second fetch of a value that has already
+ * been checked would not be the value that was checked.
+ */
+ in_sz = READ_ONCE(hs_page1->cl_in_max_entry_size);
+ out_sz = READ_ONCE(hs_page1->cl_out_max_entry_size);
+ list_depth = READ_ONCE(hs_page1->cl_inout_list_depth);
+ new_max_io = READ_ONCE(hs_page1->max_io_support);
+ new_max_target_id = READ_ONCE(hs_page1->max_devices_support);
+ new_capability = READ_ONCE(hs_page1->capability);
+ new_max_transfer_size = READ_ONCE(hs_page1->max_transfer_size);
+
+ /* Firmware-supplied shift counts: (1U << n) << 2 must fit. */
+ if (in_sz > 29 || out_sz > 29) {
+ dev_err(&mhba->pdev->dev,
+ "invalid handshake entry size\n");
+ return -1;
+ }
+
+ new_ib_max_size = (1U << in_sz) << 2;
+ new_ob_max_size = (1U << out_sz) << 2;
- mhba->ob_max_size_setting = hs_page1->cl_out_max_entry_size;
- mhba->ob_max_size = (1 << hs_page1->cl_out_max_entry_size) << 2;
+ /*
+ * A target above MVUMI_MAX_TARGET_ID cannot be addressed: its
+ * id would land in the LUN byte of device_id and alias another
+ * device. It is also what makes the loop counter in
+ * mvumi_flush_cache() wrap before it reaches the bound.
+ */
+ if (new_max_target_id > MVUMI_MAX_TARGET_ID) {
+ dev_err(&mhba->pdev->dev,
+ "too many devices reported: %u\n",
+ new_max_target_id);
+ return -1;
+ }
+
+ /* An entry has to hold the frame the driver puts in it. */
+ if (new_ib_max_size < sizeof(struct mvumi_msg_frame) +
+ sizeof(struct mvumi_sgl) ||
+ new_ob_max_size < sizeof(struct mvumi_rsp_frame) +
+ sizeof(struct mvumi_sense_data)) {
+ dev_err(&mhba->pdev->dev,
+ "handshake entry size too small: in %u, out %u\n",
+ new_ib_max_size, new_ob_max_size);
+ return -1;
+ }
+
+ new_list_num_io = list_depth;
+ if (new_capability & HS_CAPABILITY_NEW_PAGE_IO_DEPTH_DEF) {
+ if (list_depth >= 32) {
+ dev_err(&mhba->pdev->dev,
+ "invalid handshake list depth\n");
+ return -1;
+ }
+ new_list_num_io = 1U << list_depth;
+ }
+ /* The rings hold max_io entries but the index wraps on list_num_io. */
+ if (new_list_num_io == 0 || new_list_num_io > new_max_io) {
+ dev_err(&mhba->pdev->dev,
+ "invalid handshake list depth: %u entries for %u commands\n",
+ new_list_num_io, new_max_io);
+ return -1;
+ }
dev_dbg(&mhba->pdev->dev, "FW version:%d\n",
- hs_page1->fw_ver.ver_build);
+ READ_ONCE(hs_page1->fw_ver.ver_build));
+
+ /* A host reset does not reallocate, so the sizes have to stay
+ * the ones the buffers were allocated with. Only check that
+ * the firmware is not asking for more than they hold.
+ */
+ if (mhba->fw_flag & MVUMI_FW_ALLOC) {
+ if (new_max_io > mhba->max_io ||
+ new_ib_max_size > mhba->ib_max_size ||
+ new_ob_max_size > mhba->ob_max_size ||
+ new_list_num_io > mhba->list_num_io ||
+ new_max_target_id > mhba->max_target_id) {
+ dev_err(&mhba->pdev->dev,
+ "handshake sizes grew across reset\n");
+ return -1;
+ }
+ break;
+ }
+
+ mhba->max_io = new_max_io;
+ mhba->list_num_io = new_list_num_io;
+ mhba->max_transfer_size = new_max_transfer_size;
+ mhba->max_target_id = new_max_target_id;
+ mhba->hba_capability = new_capability;
+ mhba->ib_max_size_setting = in_sz;
+ mhba->ib_max_size = new_ib_max_size;
+ mhba->ob_max_size_setting = out_sz;
+ mhba->ob_max_size = new_ob_max_size;
if (mhba->hba_capability & HS_CAPABILITY_SUPPORT_COMPACT_SG)
mhba->eot_flag = 22;
else
mhba->eot_flag = 27;
- if (mhba->hba_capability & HS_CAPABILITY_NEW_PAGE_IO_DEPTH_DEF)
- mhba->list_num_io = 1 << hs_page1->cl_inout_list_depth;
break;
+ }
default:
dev_err(&mhba->pdev->dev, "handshake: page code error\n");
return -1;
@@ -1237,7 +1334,7 @@ static unsigned char mvumi_handshake_event(struct mvumi_hba *mhba)
static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)
{
- unsigned int tmp;
+ unsigned int tmp, steps;
unsigned long before;
before = jiffies;
@@ -1258,6 +1355,7 @@ static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)
mhba->fw_state = FW_STATE_STARTING;
dev_dbg(&mhba->pdev->dev, "start firmware handshake...\n");
+ steps = 0;
do {
if (mvumi_handshake_event(mhba)) {
dev_err(&mhba->pdev->dev,
@@ -1265,6 +1363,12 @@ static unsigned char mvumi_check_handshake(struct mvumi_hba *mhba)
mhba->fw_state);
return -1;
}
+ if (++steps > MVUMI_HS_MAX_STEPS) {
+ dev_err(&mhba->pdev->dev,
+ "handshake did not finish in %u steps, state 0x%x.\n",
+ MVUMI_HS_MAX_STEPS, mhba->fw_state);
+ return -1;
+ }
} while (mhba->fw_state != FW_STATE_STARTED);
dev_dbg(&mhba->pdev->dev, "firmware handshake done\n");
@@ -1361,7 +1465,8 @@ static void mvumi_show_event(struct mvumi_hba *mhba,
if (ptr->param_count) {
printk(KERN_WARNING "Event param(len 0x%x): ",
ptr->param_count);
- for (i = 0; i < ptr->param_count; i++)
+ for (i = 0; i < ptr->param_count &&
+ i < ARRAY_SIZE(ptr->params); i++)
printk(KERN_WARNING "0x%x ", ptr->params[i]);
printk(KERN_WARNING "\n");
@@ -1370,7 +1475,8 @@ static void mvumi_show_event(struct mvumi_hba *mhba,
if (ptr->sense_data_length) {
printk(KERN_WARNING "Event sense data(len 0x%x): ",
ptr->sense_data_length);
- for (i = 0; i < ptr->sense_data_length; i++)
+ for (i = 0; i < ptr->sense_data_length &&
+ i < sizeof(ptr->sense_data); i++)
printk(KERN_WARNING "0x%x ", ptr->sense_data[i]);
printk(KERN_WARNING "\n");
}
@@ -1644,31 +1750,38 @@ static int mvumi_rescan_bus(void *data)
static void mvumi_proc_msg(struct mvumi_hba *mhba,
struct mvumi_hotplug_event *param)
{
- u16 size = param->size;
- const unsigned long *ar_bitmap;
- const unsigned long *re_bitmap;
+ u16 size = READ_ONCE(param->size);
+ const u8 *ar_bitmap;
+ const u8 *re_bitmap;
int index;
+ /*
+ * The second bitmap starts size bits into the event buffer, so that
+ * is the furthest the two walks reach. Bound it by the length the
+ * firmware was told it may write, not by the buffer: the bytes past
+ * that are still zero, and a zero bit here means a device is present.
+ */
+ if (sizeof(*param) + (size >> 3) + BITS_TO_LONGS(size) * sizeof(long) >
+ sizeof(struct mvumi_event_req)) {
+ dev_err(&mhba->pdev->dev,
+ "invalid hotplug event bitmap size %u\n", size);
+ return;
+ }
+
if (mhba->fw_flag & MVUMI_FW_ATTACH) {
- index = -1;
- ar_bitmap = (const unsigned long *) param->bitmap;
- re_bitmap = (const unsigned long *) ¶m->bitmap[size >> 3];
+ ar_bitmap = param->bitmap;
+ re_bitmap = ¶m->bitmap[size >> 3];
mutex_lock(&mhba->sas_discovery_mutex);
- do {
- index = find_next_zero_bit(ar_bitmap, size, index + 1);
- if (index >= size)
- break;
- mvumi_handle_hotplug(mhba, index, DEVICE_ONLINE);
- } while (1);
-
- index = -1;
- do {
- index = find_next_zero_bit(re_bitmap, size, index + 1);
- if (index >= size)
- break;
- mvumi_handle_hotplug(mhba, index, DEVICE_OFFLINE);
- } while (1);
+ for (index = 0; index < size; index++)
+ if (!(ar_bitmap[index >> 3] & (1 << (index & 7))))
+ mvumi_handle_hotplug(mhba, index,
+ DEVICE_ONLINE);
+
+ for (index = 0; index < size; index++)
+ if (!(re_bitmap[index >> 3] & (1 << (index & 7))))
+ mvumi_handle_hotplug(mhba, index,
+ DEVICE_OFFLINE);
mutex_unlock(&mhba->sas_discovery_mutex);
}
}
@@ -1700,7 +1813,7 @@ static int mvumi_get_event(struct mvumi_hba *mhba, unsigned char msg)
struct mvumi_cmd *cmd;
struct mvumi_msg_frame *frame;
- cmd = mvumi_create_internal_cmd(mhba, 512);
+ cmd = mvumi_create_internal_cmd(mhba, MVUMI_EVENT_BUF_SIZE);
if (!cmd)
return -1;
cmd->scmd = NULL;
@@ -1765,6 +1878,7 @@ static void mvumi_handle_clob(struct mvumi_hba *mhba)
struct mvumi_rsp_frame *ob_frame;
struct mvumi_cmd *cmd;
struct mvumi_ob_data *pool;
+ unsigned short tag;
while (!list_empty(&mhba->free_ob_list)) {
pool = list_first_entry(&mhba->free_ob_list,
@@ -1773,11 +1887,33 @@ static void mvumi_handle_clob(struct mvumi_hba *mhba)
list_add_tail(&pool->list, &mhba->ob_data_list);
ob_frame = (struct mvumi_rsp_frame *) &pool->data[0];
- cmd = mhba->tag_cmd[ob_frame->tag];
+ /*
+ * The tag was checked against the frame in the outbound list.
+ * This is the copy, so check the value that is used.
+ */
+ tag = ob_frame->tag;
+ if (tag >= mhba->tag_pool.size) {
+ dev_err(&mhba->pdev->dev,
+ "ob frame tag[0x%x] out of range\n", tag);
+ continue;
+ }
+ cmd = mhba->tag_cmd[tag];
+ if (!cmd) {
+ dev_err(&mhba->pdev->dev,
+ "ob frame tag[0x%x] with no command\n", tag);
+ continue;
+ }
+ if (mhba->request_id_enabled &&
+ ob_frame->request_id != cmd->request_id) {
+ dev_err(&mhba->pdev->dev,
+ "ob frame tag[0x%x] request ID 0x%x != 0x%x\n",
+ tag, ob_frame->request_id, cmd->request_id);
+ continue;
+ }
atomic_dec(&mhba->fw_outstanding);
- mhba->tag_cmd[ob_frame->tag] = NULL;
- tag_release_one(mhba, &mhba->tag_pool, ob_frame->tag);
+ mhba->tag_cmd[tag] = NULL;
+ tag_release_one(mhba, &mhba->tag_pool, tag);
if (cmd->scmd)
mvumi_complete_cmd(mhba, cmd, ob_frame);
else
diff --git a/drivers/scsi/mvumi.h b/drivers/scsi/mvumi.h
index 1306a4abf19ad..9597e87a08167 100644
--- a/drivers/scsi/mvumi.h
+++ b/drivers/scsi/mvumi.h
@@ -124,6 +124,21 @@ enum {
#define APICDB1_HOST_GETEVENT 1
#define MAX_EVENTS_RETURNED 6
+/* size of the buffer the driver hands the firmware for event replies */
+#define MVUMI_EVENT_BUF_SIZE 512
+
+/*
+ * mvumi_build_frame() packs the target id into the low byte of device_id
+ * and the LUN into the high byte, so only these ids can be addressed.
+ */
+#define MVUMI_MAX_TARGET_ID 255
+
+/*
+ * Stamped into a consumed outbound list entry. A valid tag is below
+ * tag_pool.size, which is a u16, so the largest u16 is never one.
+ */
+#define MVUMI_TAG_CONSUMED 0xffff
+
#define DEVICE_OFFLINE 0
#define DEVICE_ONLINE 1
@@ -180,20 +195,10 @@ struct mvumi_compact_sgl {
u32 flags;
};
-#define GET_COMPACT_SGD_SIZE(sgd) \
- ((((struct mvumi_compact_sgl *)(sgd))->flags) & 0x3FFFFFL)
-
#define SET_COMPACT_SGD_SIZE(sgd, sz) do { \
(((struct mvumi_compact_sgl *)(sgd))->flags) &= ~0x3FFFFFL; \
(((struct mvumi_compact_sgl *)(sgd))->flags) |= (sz); \
} while (0)
-#define sgd_getsz(_mhba, sgd, sz) do { \
- if (_mhba->hba_capability & HS_CAPABILITY_SUPPORT_COMPACT_SG) \
- (sz) = GET_COMPACT_SGD_SIZE(sgd); \
- else \
- (sz) = (sgd)->size; \
-} while (0)
-
#define sgd_setsz(_mhba, sgd, sz) do { \
if (_mhba->hba_capability & HS_CAPABILITY_SUPPORT_COMPACT_SG) \
SET_COMPACT_SGD_SIZE(sgd, sz); \
@@ -250,6 +255,8 @@ struct mvumi_cmd {
struct scsi_cmnd *scmd;
atomic_t sync_cmd;
void *data_buf;
+ dma_addr_t data_buf_phys;
+ unsigned int data_buf_size;
unsigned short request_id;
unsigned char cmd_status;
};
@@ -392,6 +399,15 @@ struct mvumi_hs_header {
#define HS_PAGE_CL_INFO 0x4
#define HS_PAGE_TOTAL 0x5
+/*
+ * Each mvumi_handshake() call advances the state machine by one step: four
+ * fixed steps, plus one per page the firmware asks for in the u8 total_pages,
+ * plus a restart if it ever reports a status other than HS_STATUS_OK. This
+ * caps how many steps the driver will take before giving up, so that a
+ * firmware that keeps the handshake going cannot keep it going forever.
+ */
+#define MVUMI_HS_MAX_STEPS 1024
+
#define HSP_SIZE(i) sizeof(struct mvumi_hs_page##i)
#define HSP_MAX_SIZE ({ \
|
| 3/2 | 2026/10/15 06:50 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10016 output: 30 thoughts: 112 Thoughts: **Analyzing the Proposed Patch** Okay, let's dive into this. This patch touches `drivers/scsi/mvumi.c` and `drivers/scsi/mvumi.h`. My immediate thought is, I need to understand the "mvumi" context before anything else. It's crucial to understand what this driver *is*. Is this a PCI driver? What kind of hardware is it responsible for managing? Is it a legacy controller, or something more modern? Crucially, I have to determine its accessibility for testing. Can I reach it through QEMU? Is there a possibility for testing it using syzkaller or other virtualized environments? Knowing the testing access is critical to my investigation. Therefore, the first order of business is to deeply inspect `drivers/scsi/mvumi.c` and cross-reference its configuration with the `Kconfig` files. That should give me the base context that I require. |
| 4/2 | 2026/10/15 06:51 | tool | grepper |
0mArgs:{
"Expression": "SCSI_MVUMI",
"PathPrefixes": [
"drivers/scsi"
]
}Results: {
"Output": "drivers/scsi/Kconfig=462=source \"drivers/scsi/mvsas/Kconfig\"\ndrivers/scsi/Kconfig-463-\ndrivers/scsi/Kconfig:464:config SCSI_MVUMI\ndrivers/scsi/Kconfig-465-\ttristate \"Marvell UMI driver\"\n--\ndrivers/scsi/Makefile=153=obj-$(CONFIG_SCSI_MVSAS)\t+= mvsas/\ndrivers/scsi/Makefile:154:obj-$(CONFIG_SCSI_MVUMI)\t+= mvumi.o\ndrivers/scsi/Makefile-155-obj-$(CONFIG_PS3_ROM)\t\t+= ps3rom.o\n"
} |
| 5/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10539 output: 35 thoughts: 37 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Investigating SCSI_MVUMI Driver Dependencies** Alright, let's dive into this. My first thought is to take a look at the `drivers/scsi/Kconfig` file. I'm going to zero in around line 464, that seems like a likely spot given the context. The goal here is straightforward: I want to pin down what `SCSI_MVUMI` is, exactly, and more importantly, what it *depends* on in terms of other kernel configuration options. Understanding those dependencies is crucial. It informs both how the driver interacts with the rest of the SCSI subsystem and where potential conflicts or support gaps might lie if I'm trying to, say, enable or troubleshoot this driver. So, Kconfig it is, time to get the lay of the land. |
| 6/2 | 2026/10/15 06:51 | tool | read-file |
0mArgs:{
"File": "drivers/scsi/Kconfig",
"FirstLine": 460,
"LineCount": 20
}Results: {
"Contents": " 460:\tsource \"drivers/scsi/aic94xx/Kconfig\"\n 461:\tsource \"drivers/scsi/hisi_sas/Kconfig\"\n 462:\tsource \"drivers/scsi/mvsas/Kconfig\"\n 463:\t\n 464:\tconfig SCSI_MVUMI\n 465:\t\ttristate \"Marvell UMI driver\"\n 466:\t\tdepends on SCSI \u0026\u0026 PCI\n 467:\t\thelp\n 468:\t\t Module for Marvell Universal Message Interface(UMI) driver\n 469:\t\n 470:\t\t To compile this driver as a module, choose M here: the\n 471:\t\t module will be called mvumi.\n 472:\t\n 473:\tconfig SCSI_ADVANSYS\n 474:\t\ttristate \"AdvanSys SCSI support\"\n 475:\t\tdepends on SCSI\n 476:\t\tdepends on (ISA || EISA || PCI) \u0026\u0026 HAS_IOPORT\n 477:\t\thelp\n 478:\t\t This is a driver for all SCSI host adapters manufactured by\n 479:\t\t AdvanSys. It is documented in the kernel source in\n"
} |
| 7/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11109 output: 36 thoughts: 40 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the Marvell Universal Message Interface (UMI) Driver** Alright, so `mvumi` is the Marvell Universal Message Interface (UMI) driver. My first instinct, of course, is to dive into the code. Specifically, I'm heading straight for `drivers/scsi/mvumi.c`. That's where the rubber meets the road, where the supported hardware is defined. I need to quickly ascertain which PCI IDs this driver handles. Knowing the supported devices is fundamental to understanding its scope and compatibility. Time to check those vendor and device IDs. I'm looking for a quick scan through the initialization and probe functions – the device table should be front and center. I want to see how broadly it's intended to work, perhaps looking for any interesting patterns or families of devices that it supports. Let's get to it. |
| 8/2 | 2026/10/15 06:51 | tool | grepper |
0mArgs:{
"Expression": "pci_device_id",
"PathPrefixes": [
"drivers/scsi/mvumi.c"
]
}Results: {
"Output": "drivers/scsi/mvumi.c=34=MODULE_DESCRIPTION(\"Marvell UMI Driver\");\ndrivers/scsi/mvumi.c-35-\ndrivers/scsi/mvumi.c:36:static const struct pci_device_id mvumi_pci_table[] = {\ndrivers/scsi/mvumi.c-37-\t{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, PCI_DEVICE_ID_MARVELL_MV9143) },\n--\ndrivers/scsi/mvumi.c=2521=static int mvumi_io_attach(struct mvumi_hba *mhba)\n--\ndrivers/scsi/mvumi.c-2588- */\ndrivers/scsi/mvumi.c:2589:static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)\ndrivers/scsi/mvumi.c-2590-{\n"
} |
| 9/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11628 output: 36 thoughts: 25 Thoughts: Okay, let's dive into this. Here's how I'd approach that snippet, considering I'm an expert in the field: **Diving into the mvumi Driver's PCI Table** Alright, my internal radar is pinging. I need to get a handle on how this `mvumi` driver, likely a Marvell-based SCSI adapter, is handling its PCI device initialization. First, the crucial piece is usually the PCI ID table, the `mvumi_pci_table` itself. That table is the driver's whitelist, the go-to reference that defines what hardware it recognizes and claims. So, I need to check `mvumi_pci_table` within the `drivers/scsi/mvumi.c` source file. It’s the cornerstone; it will tell me what specific device IDs the driver is designed to work with, what vendor IDs, subsystem IDs, and perhaps even revision IDs are supported. Is it a generic table, or is it specific to a few select adapters? Knowing this will immediately inform me about the potential breadth of the driver's support and any potential compatibility concerns I need to keep in mind. Let’s see what's in there. |
| 10/2 | 2026/10/15 06:51 | tool | read-file |
0mArgs:{
"File": "drivers/scsi/mvumi.c",
"FirstLine": 35,
"LineCount": 20
}Results: {
"Contents": " 35:\t\n 36:\tstatic const struct pci_device_id mvumi_pci_table[] = {\n 37:\t\t{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, PCI_DEVICE_ID_MARVELL_MV9143) },\n 38:\t\t{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, PCI_DEVICE_ID_MARVELL_MV9580) },\n 39:\t\t{ 0 }\n 40:\t};\n 41:\t\n 42:\tMODULE_DEVICE_TABLE(pci, mvumi_pci_table);\n 43:\t\n 44:\tstatic void tag_init(struct mvumi_tag *st, unsigned short size)\n 45:\t{\n 46:\t\tunsigned short i;\n 47:\t\tBUG_ON(size != st-\u003esize);\n 48:\t\tst-\u003etop = size;\n 49:\t\tfor (i = 0; i \u003c size; i++)\n 50:\t\t\tst-\u003estack[i] = size - 1 - i;\n 51:\t}\n 52:\t\n 53:\tstatic unsigned short tag_get_one(struct mvumi_hba *mhba, struct mvumi_tag *st)\n 54:\t{\n"
} |
| 11/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12281 output: 43 thoughts: 404 Thoughts: **My Assessment of WorthFuzzing for Marvell MV9143/MV9580** Okay, let's break this down. My initial thought was whether QEMU could emulate the Marvell MV9143 and MV9580 SAS/SATA RAID controllers. If it did, it would be a prime candidate for fuzzing. However, a quick check reveals that standard QEMU doesn't offer that specific emulation, nor does it seem like there's any obvious virtual bus emulation for Marvell's UMI. Now, before dismissing it completely, I need to consult the "WorthFuzzing" criteria. Specifically, Section 2 outlines the negative criteria, those situations where fuzzing wouldn't be productive. The key phrase here is "Structurally unreachable hardware." This specifically calls out vendor-specific PCIe switches, SmartNICs, and GPU drivers. My immediate concern is whether the Marvell controllers fall into that category. The document does list a few examples such as mlxsw, pds_core, qed, ionic, amdgpu. The document indicates that if these devices require physical ASICs or PCIe cards *not* emulated by QEMU, then it's a no-go for fuzzing. My next line of thought is SCSI drivers in general. Can syzkaller interact with PCI devices? The answer is no, unless QEMU provides emulation or there's a software emulation present, like virtio, or usb gadget implementations. So, back to the question: does QEMU emulate the MV9143 or MV9580? Sadly, no. It supports the more generic lsi53c895a, megasas, virtio-scsi, esp, and am53c974. The final question is whether mvumi has any *software-only* entry points, independent of the PCI device itself, like a character device, ioctl calls, or other access points. I need to check the source code, specifically `drivers/scsi/mvumi.c`, to see if there are any file operations, char devices, sysfs entries, debugfs, ioctl implementations, or netlink interfaces. If I find any such entry points, then there's a chance to fuzz parts of the driver even without full hardware emulation. I need to examine the source to be sure. |
| 12/2 | 2026/10/15 06:51 | tool | grepper |
0mError:no matches Args: {
"Expression": "file_operations|miscdevice|proc_create|debugfs",
"PathPrefixes": [
"drivers/scsi/mvumi.c"
]
}Results: {
"error": "no matches"
} |
| 13/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13245 output: 40 thoughts: 23 Thoughts: Okay, here's my summary, tailored for an expert audience, in the first person, reflecting the given thought process: **Diving into the `mvumi.c` Source for Configuration Options** Alright, let's get down to brass tacks. I need to figure out how this thing is configured. First and foremost, before I start down any rabbit holes, I'm going to scan the `mvumi.c` source code. My gut tells me there might be some valuable clues lurking within. Specifically, I'm looking for the standard suspects: * **sysfs attributes:** Always a good starting point. See if there are any exposed controls for runtime adjustments. I need to check for any files exposed within the `/sys/class/` and `/sys/bus/` hierarchies. Any file operations or attribute definitions that catch my eye will be helpful here. * **Module parameters:** These are the bread and butter for initial configuration. Did they define any module parameters? Anything adjustable at load time will be key, so I'll be looking for `module_param()` macros, or even better yet, more sophisticated approaches with `module_param_named()` or similar constructs. I need to be ready to analyze the types, defaults, and descriptions. * **Anything else within the code:** I'm not limiting myself to just those two areas though. I'll need to skim the code for potential configuration or debug settings, perhaps set with a compile time define, or hard coded values that I may need to override. The goal is to get a solid understanding of all the tunable levers I have at my disposal, before I get lost in the weeds. A systematic approach will be key to avoiding unnecessary rework later on. |
| 14/2 | 2026/10/15 06:51 | tool | grepper |
0mError:no matches Args: {
"Expression": "DEVICE_ATTR|sysfs|module_param",
"PathPrefixes": [
"drivers/scsi/mvumi.c"
]
}Results: {
"error": "no matches"
} |
| 15/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13686 output: 37 thoughts: 44 Thoughts: Okay, here's my take on those thoughts, framed as my own: **Investigating the mvumi Driver's SCSI Host Template** Right, so `mvumi.c` is missing both sysfs integration and module parameters. That's a bit unusual, and it immediately makes me curious about how it's configured and exposed. Given that, my next step is clear. I need to dive into the `scsi_host_template` structure within `mvumi.c`. That template is the heart of any SCSI host adapter driver, defining all the core operations and functionalities. I'll need to scrutinize what SCSI template operations this particular driver offers to understand how it interacts with the SCSI subsystem. This should provide some insight into how the driver is being controlled and how configuration is handled. Let's see what's being exposed. |
| 16/2 | 2026/10/15 06:51 | tool | grepper |
0mArgs:{
"Expression": "struct scsi_host_template",
"PathPrefixes": [
"drivers/scsi/mvumi.c"
]
}Results: {
"Output": "drivers/scsi/mvumi.c=2280=mvumi_bios_param(struct scsi_device *sdev, struct gendisk *unused,\n--\ndrivers/scsi/mvumi.c-2306-\ndrivers/scsi/mvumi.c:2307:static const struct scsi_host_template mvumi_template = {\ndrivers/scsi/mvumi.c-2308-\n"
} |
| 17/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14059 output: 38 thoughts: 20 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the mvumi Template and Function** Alright, let's dive in. My immediate focus is on the interplay between `mvumi_template` and the associated function in `mvumi.c`. I'm going to carefully read `mvumi_template` first. I'm looking for its structural elements, the data layout it expects, and any hints about how it interacts with the underlying hardware or software components. I need to understand its purpose – is it a configuration structure, a command descriptor, or something else entirely? Then, I'll switch gears and probe the function in `mvumi.c`. I'll be tracing the execution flow to see how the template is used. I'm particularly interested in how the function parses the template's data, validates its contents, and ultimately, what actions it triggers. Are there any error handling mechanisms? What are the implications of different template configurations? I will also focus on the key data structures and any assumptions being made about their contents or size. I'll need to see the function's interaction with any underlying hardware or device drivers to get a complete picture. Basically, I'm trying to mentally map out the execution path and identify any potential gotchas or optimization opportunities. I'm expecting some standard approaches for how the template is read and used. |
| 18/2 | 2026/10/15 06:51 | tool | read-file |
0mArgs:{
"File": "drivers/scsi/mvumi.c",
"FirstLine": 2305,
"LineCount": 40
}Results: {
"Contents": "2305:\t}\n2306:\t\n2307:\tstatic const struct scsi_host_template mvumi_template = {\n2308:\t\n2309:\t\t.module = THIS_MODULE,\n2310:\t\t.name = \"Marvell Storage Controller\",\n2311:\t\t.sdev_configure = mvumi_sdev_configure,\n2312:\t\t.queuecommand = mvumi_queue_command,\n2313:\t\t.eh_timed_out = mvumi_timed_out,\n2314:\t\t.eh_host_reset_handler = mvumi_host_reset,\n2315:\t\t.bios_param = mvumi_bios_param,\n2316:\t\t.dma_boundary = PAGE_SIZE - 1,\n2317:\t\t.this_id = -1,\n2318:\t\t.cmd_size = sizeof(struct mvumi_cmd_priv),\n2319:\t};\n2320:\t\n2321:\tstatic int mvumi_cfg_hw_reg(struct mvumi_hba *mhba)\n2322:\t{\n2323:\t\tvoid *base = NULL;\n2324:\t\tstruct mvumi_hw_regs *regs;\n2325:\t\n2326:\t\tswitch (mhba-\u003epdev-\u003edevice) {\n2327:\t\tcase PCI_DEVICE_ID_MARVELL_MV9143:\n2328:\t\t\tmhba-\u003emmio = mhba-\u003ebase_addr[0];\n2329:\t\t\tbase = mhba-\u003emmio;\n2330:\t\t\tif (!mhba-\u003eregs) {\n2331:\t\t\t\tmhba-\u003eregs = kzalloc_obj(*regs);\n2332:\t\t\t\tif (mhba-\u003eregs == NULL)\n2333:\t\t\t\t\treturn -ENOMEM;\n2334:\t\t\t}\n2335:\t\t\tregs = mhba-\u003eregs;\n2336:\t\n2337:\t\t\t/* For Arm */\n2338:\t\t\tregs-\u003ectrl_sts_reg = base + 0x20104;\n2339:\t\t\tregs-\u003erstoutn_mask_reg = base + 0x20108;\n2340:\t\t\tregs-\u003esys_soft_rst_reg = base + 0x2010C;\n2341:\t\t\tregs-\u003emain_int_cause_reg = base + 0x20200;\n2342:\t\t\tregs-\u003eenpointa_mask_reg = base + 0x2020C;\n2343:\t\t\tregs-\u003erstoutn_en_reg = base + 0xF1400;\n2344:\t\t\t/* For Doorbell */\n"
} |
| 19/2 | 2026/10/15 06:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 15107 output: 132 thoughts: 1112 Thoughts: **mvumi Triage: Structurally Unreachable Code** Okay, let's break this down systematically. I need to determine if this change to `mvumi.c` is fuzzable within a standard environment. First, I'm checking how the `mvumi` driver is initialized: `pci_register_driver(&mvumi_pci_driver)`. It's a standard PCI driver, and `mvumi_probe_one` is triggered by the presence of a Marvell MV9143 or MV9580 RAID controller. But here's the kicker: Without the *physical* hardware, `mvumi_probe_one` is never called. This means that none of the code within `mvumi.c` will execute in standard QEMU or GCE testbeds – a crucial point for fuzzing. I'm referring to the triage instructions on reachability. The primary gate is reachability. The instructions explicitly state that fuzzing is limited to code that *can* execute in virtualized environments. Unreachable hardware code, like the vendor-specific PCIe drivers, should not be fuzzed. Now, let's verify. Can `mvumi` be reached without physical hardware? Are there any drivers like vfio, virtio, or usb that interact with it? No. `mvumi` is a SCSI host adapter driver specifically for those Marvell RAID controllers. It communicates with the controller using MMIO registers and DMA memory. The patch itself is clearly hardening the driver against malicious or corrupted firmware responses, guarding against things like `frame_length` exceeding bounds, invalid sizes, and out-of-range values. The code is specifically checking inputs from the firmware. It's security-focused. But the problem remains: syzkaller runs in standard QEMU/GCE, and these environments lack the Marvell MV9143 or MV9580 devices. Therefore, the driver cannot probe and cannot be fuzzed. Now, checking the impacted files via `git show --stat`: It's just `drivers/scsi/mvumi.c` and `drivers/scsi/mvumi.h`. So, should `WorthFuzzing` be `false`? Absolutely. It falls directly under the category of "Structurally unreachable hardware": a vendor-specific PCI driver. This code requires physical hardware not emulated in standard environments. I need to confirm the fields for `set-results`: * `WorthFuzzing`: false * `Reasoning`: `drivers/scsi/mvumi.c` is a PCI driver for Marvell MV9143 and MV9580 RAID controllers, which require physical hardware and are not emulated in standard QEMU/GCE environments, making the modified code structurally unreachable for syzkaller. * `EnableConfigs`: \[ ] * `FocusSymbols`: \[ ] I'm double-checking everything: 1. Is a core subsystem touched? No, only the `mvumi` driver. 2. Can `mvumi` be emulated in standard QEMU? No. 3. Can user-space reach any part of this driver without hardware probing? No. No sysfs, no debugfs, no character device, no ioctls outside scsi_device (which, again, requires probing). 4. The code is structurally unreachable. My analysis is completely in line with the triage guidelines. I'm confident in calling `set-results` now. |
| 20/2 | 2026/10/15 06:51 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies the Marvell UMI (mvumi) SCSI host controller driver (drivers/scsi/mvumi.c and drivers/scsi/mvumi.h). This driver is for specific Marvell storage controllers (MV9143 and MV9580) that require physical PCIe hardware not emulated in standard QEMU or GCE virtualized environments. Consequently, the modified code cannot be probed or executed in syzkaller fuzzing environments and is structurally unreachable.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the Marvell UMI (mvumi) SCSI host controller driver (drivers/scsi/mvumi.c and drivers/scsi/mvumi.h). This driver is for specific Marvell storage controllers (MV9143 and MV9580) that require physical PCIe hardware not emulated in standard QEMU or GCE virtualized environments. Consequently, the modified code cannot be probed or executed in syzkaller fuzzing environments and is structurally unreachable.",
"WorthFuzzing": false
} |
| 21/1 | 2026/10/15 06:51 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|