| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/07 22:03 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies the Microsoft Azure Network Adapter (MANA) driver, which is a vendor-specific PCIe device driver. This hardware is not emulated in standard QEMU or GCE environments used by syzkaller, making the code paths unreachable during standard fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/08/07 22:03 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit bd8becd05b220ee4c0cc0f32d4182d58c256feea\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Aug 7 22:03:44 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c\nindex a38d4bb74621f..ed9af314e4ede 100644\n--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c\n+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c\n@@ -11,6 +11,7 @@\n #include \u003clinux/msi.h\u003e\n #include \u003clinux/irqdomain.h\u003e\n #include \u003clinux/export.h\u003e\n+#include \u003clinux/uaccess.h\u003e\n \n #include \u003cnet/mana/mana.h\u003e\n #include \u003cnet/mana/hw_channel.h\u003e\n@@ -374,28 +375,96 @@ int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req,\n EXPORT_SYMBOL_NS(mana_gd_send_request, \"NET_MANA\");\n \n int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length,\n-\t\t\t struct gdma_mem_info *gmi)\n+\t\t\t struct gdma_mem_info *gmi, bool allow_scatter)\n {\n+\tunsigned int npages, i;\n \tdma_addr_t dma_handle;\n+\tbool can_fallback;\n \tvoid *buf;\n \n \tif (length \u003c MANA_PAGE_SIZE || !is_power_of_2(length))\n \t\treturn -EINVAL;\n \n \tgmi-\u003edev = gc-\u003edev;\n-\tbuf = dma_alloc_coherent(gmi-\u003edev, length, \u0026dma_handle, GFP_KERNEL);\n-\tif (!buf)\n+\n+\t/* An allocation that fits in one page does not benefit from\n+\t * fallback.\n+\t */\n+\tcan_fallback = allow_scatter \u0026\u0026 length \u003e PAGE_SIZE;\n+\n+\t/* Warn only when there is no fallback to rescue the failure. */\n+\tbuf = dma_alloc_coherent(gmi-\u003edev, length, \u0026dma_handle,\n+\t\t\t\t GFP_KERNEL |\n+\t\t\t\t (can_fallback ? __GFP_NOWARN : 0));\n+\tif (buf) {\n+\t\tgmi-\u003edma_handle = dma_handle;\n+\t\tgmi-\u003evirt_addr = buf;\n+\t\tgmi-\u003elength = length;\n+\t\tgmi-\u003enr_pages = 0;\n+\t\treturn 0;\n+\t}\n+\n+\tif (!can_fallback)\n \t\treturn -ENOMEM;\n \n-\tgmi-\u003edma_handle = dma_handle;\n-\tgmi-\u003evirt_addr = buf;\n+\t/* length is a power of 2 above PAGE_SIZE, so this divides exactly. */\n+\tnpages = length / PAGE_SIZE;\n+\n+\tgmi-\u003epages_va = kvcalloc(npages, sizeof(*gmi-\u003epages_va), GFP_KERNEL);\n+\tif (!gmi-\u003epages_va)\n+\t\treturn -ENOMEM;\n+\n+\tgmi-\u003epages_dma = kvcalloc(npages, sizeof(*gmi-\u003epages_dma), GFP_KERNEL);\n+\tif (!gmi-\u003epages_dma)\n+\t\tgoto free_va;\n+\n+\tfor (i = 0; i \u003c npages; i++) {\n+\t\tgmi-\u003epages_va[i] = dma_alloc_coherent(gmi-\u003edev, PAGE_SIZE,\n+\t\t\t\t\t\t \u0026gmi-\u003epages_dma[i],\n+\t\t\t\t\t\t GFP_KERNEL);\n+\t\tif (!gmi-\u003epages_va[i])\n+\t\t\tgoto free_pages;\n+\t}\n+\n+\tdev_info_ratelimited(gmi-\u003edev,\n+\t\t\t \"contiguous %u-byte DMA alloc failed; using %u scattered pages\\n\",\n+\t\t\t length, npages);\n+\n+\tgmi-\u003evirt_addr = NULL;\n+\tgmi-\u003edma_handle = 0;\n \tgmi-\u003elength = length;\n+\tgmi-\u003enr_pages = npages;\n \n \treturn 0;\n+\n+free_pages:\n+\twhile (i--)\n+\t\tdma_free_coherent(gmi-\u003edev, PAGE_SIZE, gmi-\u003epages_va[i],\n+\t\t\t\t gmi-\u003epages_dma[i]);\n+\tkvfree(gmi-\u003epages_dma);\n+\tgmi-\u003epages_dma = NULL;\n+free_va:\n+\tkvfree(gmi-\u003epages_va);\n+\tgmi-\u003epages_va = NULL;\n+\treturn -ENOMEM;\n }\n \n void mana_gd_free_memory(struct gdma_mem_info *gmi)\n {\n+\tunsigned int i;\n+\n+\tif (gmi-\u003enr_pages \u003e 0) {\n+\t\tfor (i = 0; i \u003c gmi-\u003enr_pages; i++)\n+\t\t\tdma_free_coherent(gmi-\u003edev, PAGE_SIZE, gmi-\u003epages_va[i],\n+\t\t\t\t\t gmi-\u003epages_dma[i]);\n+\t\tkvfree(gmi-\u003epages_va);\n+\t\tkvfree(gmi-\u003epages_dma);\n+\t\tgmi-\u003epages_va = NULL;\n+\t\tgmi-\u003epages_dma = NULL;\n+\t\tgmi-\u003enr_pages = 0;\n+\t\treturn;\n+\t}\n+\n \tdma_free_coherent(gmi-\u003edev, gmi-\u003elength, gmi-\u003evirt_addr,\n \t\t\t gmi-\u003edma_handle);\n }\n@@ -753,11 +822,73 @@ int mana_schedule_serv_work(struct gdma_context *gc, enum gdma_eqe_type type)\n \treturn 0;\n }\n \n+/* Return the CPU address of byte @offset within a queue's ring buffer. */\n+static void *mana_gd_ring_ptr(const struct gdma_queue *q, u32 offset)\n+{\n+\tconst struct gdma_mem_info *gmi = \u0026q-\u003emem_info;\n+\n+\tif (gmi-\u003enr_pages \u003e 0)\n+\t\treturn (u8 *)gmi-\u003epages_va[offset / PAGE_SIZE] +\n+\t\t (offset \u0026 (PAGE_SIZE - 1));\n+\n+\treturn q-\u003equeue_mem_ptr + offset;\n+}\n+\n+/* Number of bytes from @offset to the end of the CPU-contiguous region: the\n+ * rest of the ring, or the rest of the current page when scattered.\n+ */\n+static u32 mana_gd_ring_contig_avail(const struct gdma_queue *q, u32 offset)\n+{\n+\tif (q-\u003emem_info.nr_pages \u003e 0)\n+\t\treturn PAGE_SIZE - (offset \u0026 (PAGE_SIZE - 1));\n+\n+\treturn q-\u003equeue_size - offset;\n+}\n+\n+/* Copy up to @count bytes from ring offset *@pos of @q into user buffer @buf,\n+ * so a scattered ring reads back as if it were contiguous. Returns bytes\n+ * copied, 0 at end of ring, or a negative errno.\n+ */\n+ssize_t mana_gd_read_ring(struct gdma_queue *q, char __user *buf,\n+\t\t\t size_t count, loff_t *pos)\n+{\n+\tu32 size = q-\u003equeue_size;\n+\tloff_t off = *pos;\n+\tsize_t copied = 0;\n+\n+\tif (off \u003c 0)\n+\t\treturn -EINVAL;\n+\tif (off \u003e= size || !count)\n+\t\treturn 0;\n+\tcount = min_t(size_t, count, size - off);\n+\n+\twhile (count) {\n+\t\tu32 offset = off;\n+\t\tu32 avail = mana_gd_ring_contig_avail(q, offset);\n+\t\tsize_t chunk = min_t(size_t, count, avail);\n+\t\tsize_t left = copy_to_user(buf, mana_gd_ring_ptr(q, offset),\n+\t\t\t\t\t chunk);\n+\n+\t\tchunk -= left;\n+\t\tbuf += chunk;\n+\t\toff += chunk;\n+\t\tcopied += chunk;\n+\t\tcount -= chunk;\n+\t\tif (left)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (!copied)\n+\t\treturn -EFAULT;\n+\n+\t*pos = off;\n+\treturn copied;\n+}\n+\n static void mana_gd_process_eqe(struct gdma_queue *eq)\n {\n \tu32 head = eq-\u003ehead % (eq-\u003equeue_size / GDMA_EQE_SIZE);\n \tstruct gdma_context *gc = eq-\u003egdma_dev-\u003egdma_context;\n-\tstruct gdma_eqe *eq_eqe_ptr = eq-\u003equeue_mem_ptr;\n \tunion gdma_eqe_info eqe_info;\n \tenum gdma_eqe_type type;\n \tstruct gdma_event event;\n@@ -765,7 +896,7 @@ static void mana_gd_process_eqe(struct gdma_queue *eq)\n \tstruct gdma_eqe *eqe;\n \tu32 cq_id;\n \n-\teqe = \u0026eq_eqe_ptr[head];\n+\teqe = mana_gd_ring_ptr(eq, head * sizeof(*eqe));\n \teqe_info.as_uint32 = eqe-\u003eeqe_info;\n \ttype = eqe_info.type;\n \n@@ -829,7 +960,6 @@ static void mana_gd_process_eq_events(void *arg)\n {\n \tu32 owner_bits, new_bits, old_bits;\n \tunion gdma_eqe_info eqe_info;\n-\tstruct gdma_eqe *eq_eqe_ptr;\n \tstruct gdma_queue *eq = arg;\n \tstruct gdma_context *gc;\n \tstruct gdma_eqe *eqe;\n@@ -839,11 +969,10 @@ static void mana_gd_process_eq_events(void *arg)\n \tgc = eq-\u003egdma_dev-\u003egdma_context;\n \n \tnum_eqe = eq-\u003equeue_size / GDMA_EQE_SIZE;\n-\teq_eqe_ptr = eq-\u003equeue_mem_ptr;\n \n \t/* Process up to 5 EQEs at a time, and update the HW head. */\n \tfor (i = 0; i \u003c 5; i++) {\n-\t\teqe = \u0026eq_eqe_ptr[eq-\u003ehead % num_eqe];\n+\t\teqe = mana_gd_ring_ptr(eq, (eq-\u003ehead % num_eqe) * sizeof(*eqe));\n \t\teqe_info.as_uint32 = eqe-\u003eeqe_info;\n \t\towner_bits = eqe_info.owner_bits;\n \n@@ -1107,7 +1236,7 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd,\n \t\treturn -ENOMEM;\n \n \tgmi = \u0026queue-\u003emem_info;\n-\terr = mana_gd_alloc_memory(gc, spec-\u003equeue_size, gmi);\n+\terr = mana_gd_alloc_memory(gc, spec-\u003equeue_size, gmi, false);\n \tif (err) {\n \t\tdev_err(gc-\u003edev, \"GDMA queue type: %d, size: %u, gdma memory allocation err: %d\\n\",\n \t\t\tspec-\u003etype, spec-\u003equeue_size, err);\n@@ -1182,7 +1311,7 @@ static int mana_gd_create_dma_region(struct gdma_dev *gd,\n \tif (length \u003c MANA_PAGE_SIZE || !is_power_of_2(length))\n \t\treturn -EINVAL;\n \n-\tif (!MANA_PAGE_ALIGNED(gmi-\u003evirt_addr))\n+\tif (gmi-\u003enr_pages == 0 \u0026\u0026 !MANA_PAGE_ALIGNED(gmi-\u003evirt_addr))\n \t\treturn -EINVAL;\n \n \thwc = gc-\u003ehwc.driver_data;\n@@ -1202,8 +1331,24 @@ static int mana_gd_create_dma_region(struct gdma_dev *gd,\n \treq-\u003epage_count = num_page;\n \treq-\u003epage_addr_list_len = num_page;\n \n-\tfor (i = 0; i \u003c num_page; i++)\n-\t\treq-\u003epage_addr_list[i] = gmi-\u003edma_handle + i * MANA_PAGE_SIZE;\n+\tif (gmi-\u003enr_pages \u003e 0) {\n+\t\tunsigned int subpages = PAGE_SIZE / MANA_PAGE_SIZE;\n+\t\tunsigned int idx = 0;\n+\t\tunsigned int pg, sub;\n+\n+\t\t/* Each PAGE_SIZE chunk is physically contiguous and contains\n+\t\t * PAGE_SIZE / MANA_PAGE_SIZE consecutive device pages.\n+\t\t */\n+\t\tfor (pg = 0; pg \u003c gmi-\u003enr_pages; pg++)\n+\t\t\tfor (sub = 0; sub \u003c subpages; sub++)\n+\t\t\t\treq-\u003epage_addr_list[idx++] =\n+\t\t\t\t\tgmi-\u003epages_dma[pg] +\n+\t\t\t\t\tsub * MANA_PAGE_SIZE;\n+\t} else {\n+\t\tfor (i = 0; i \u003c num_page; i++)\n+\t\t\treq-\u003epage_addr_list[i] =\n+\t\t\t\tgmi-\u003edma_handle + i * MANA_PAGE_SIZE;\n+\t}\n \n \terr = mana_gd_send_request(gc, req_msg_size, req, sizeof(resp), \u0026resp);\n \tif (err)\n@@ -1246,7 +1391,7 @@ int mana_gd_create_mana_eq(struct gdma_dev *gd,\n \t\treturn -ENOMEM;\n \n \tgmi = \u0026queue-\u003emem_info;\n-\terr = mana_gd_alloc_memory(gc, spec-\u003equeue_size, gmi);\n+\terr = mana_gd_alloc_memory(gc, spec-\u003equeue_size, gmi, true);\n \tif (err) {\n \t\tdev_err(gc-\u003edev, \"GDMA queue type: %d, size: %u, gdma memory allocation err: %d\\n\",\n \t\t\tspec-\u003etype, spec-\u003equeue_size, err);\n@@ -1301,7 +1446,7 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd,\n \tqueue-\u003eid = INVALID_QUEUE_ID;\n \n \tgmi = \u0026queue-\u003emem_info;\n-\terr = mana_gd_alloc_memory(gc, spec-\u003equeue_size, gmi);\n+\terr = mana_gd_alloc_memory(gc, spec-\u003equeue_size, gmi, true);\n \tif (err) {\n \t\tdev_err(gc-\u003edev, \"GDMA queue type: %d, size: %u, memory allocation err: %d\\n\",\n \t\t\tspec-\u003etype, spec-\u003equeue_size, err);\n@@ -1508,7 +1653,7 @@ u8 *mana_gd_get_wqe_ptr(const struct gdma_queue *wq, u32 wqe_offset)\n \n \tWARN_ON_ONCE((offset + GDMA_WQE_BU_SIZE) \u003e wq-\u003equeue_size);\n \n-\treturn wq-\u003equeue_mem_ptr + offset;\n+\treturn mana_gd_ring_ptr(wq, offset);\n }\n \n static u32 mana_gd_write_client_oob(const struct gdma_wqe_request *wqe_req,\n@@ -1554,27 +1699,24 @@ static u32 mana_gd_write_client_oob(const struct gdma_wqe_request *wqe_req,\n \treturn sizeof(header) + client_oob_size;\n }\n \n-static void mana_gd_write_sgl(struct gdma_queue *wq, u8 *wqe_ptr,\n+static void mana_gd_write_sgl(struct gdma_queue *wq, u32 sgl_offset,\n \t\t\t const struct gdma_wqe_request *wqe_req)\n {\n+\tu32 size_to_end = mana_gd_ring_contig_avail(wq, sgl_offset);\n \tu32 sgl_size = sizeof(struct gdma_sge) * wqe_req-\u003enum_sge;\n \tconst u8 *address = (u8 *)wqe_req-\u003esgl;\n-\tu8 *base_ptr, *end_ptr;\n-\tu32 size_to_end;\n-\n-\tbase_ptr = wq-\u003equeue_mem_ptr;\n-\tend_ptr = base_ptr + wq-\u003equeue_size;\n-\tsize_to_end = (u32)(end_ptr - wqe_ptr);\n \n \tif (size_to_end \u003c sgl_size) {\n-\t\tmemcpy(wqe_ptr, address, size_to_end);\n+\t\tmemcpy(mana_gd_ring_ptr(wq, sgl_offset), address, size_to_end);\n \n-\t\twqe_ptr = base_ptr;\n \t\taddress += size_to_end;\n \t\tsgl_size -= size_to_end;\n+\t\tsgl_offset += size_to_end;\n+\t\tif (sgl_offset == wq-\u003equeue_size)\n+\t\t\tsgl_offset = 0;\n \t}\n \n-\tmemcpy(wqe_ptr, address, sgl_size);\n+\tmemcpy(mana_gd_ring_ptr(wq, sgl_offset), address, sgl_size);\n }\n \n int mana_gd_post_work_request(struct gdma_queue *wq,\n@@ -1584,8 +1726,12 @@ int mana_gd_post_work_request(struct gdma_queue *wq,\n \tu32 client_oob_size = wqe_req-\u003einline_oob_size;\n \tu32 sgl_data_size;\n \tu32 max_wqe_size;\n+\tu32 wqe_offset;\n+\tu32 sgl_offset;\n \tu32 wqe_size;\n+\tu32 oob_len;\n \tu8 *wqe_ptr;\n+\tu32 head;\n \n \tif (wqe_req-\u003enum_sge == 0)\n \t\treturn -EINVAL;\n@@ -1617,13 +1763,17 @@ int mana_gd_post_work_request(struct gdma_queue *wq,\n \tif (wqe_info)\n \t\twqe_info-\u003ewqe_size_in_bu = wqe_size / GDMA_WQE_BU_SIZE;\n \n-\twqe_ptr = mana_gd_get_wqe_ptr(wq, wq-\u003ehead);\n-\twqe_ptr += mana_gd_write_client_oob(wqe_req, wq-\u003etype, client_oob_size,\n-\t\t\t\t\t sgl_data_size, wqe_ptr);\n-\tif (wqe_ptr \u003e= (u8 *)wq-\u003equeue_mem_ptr + wq-\u003equeue_size)\n-\t\twqe_ptr -= wq-\u003equeue_size;\n+\thead = wq-\u003ehead;\n+\twqe_offset = (head * GDMA_WQE_BU_SIZE) \u0026 (wq-\u003equeue_size - 1);\n+\twqe_ptr = mana_gd_get_wqe_ptr(wq, head);\n+\toob_len = mana_gd_write_client_oob(wqe_req, wq-\u003etype, client_oob_size,\n+\t\t\t\t\t sgl_data_size, wqe_ptr);\n+\n+\tsgl_offset = wqe_offset + oob_len;\n+\tif (sgl_offset \u003e= wq-\u003equeue_size)\n+\t\tsgl_offset -= wq-\u003equeue_size;\n \n-\tmana_gd_write_sgl(wq, wqe_ptr, wqe_req);\n+\tmana_gd_write_sgl(wq, sgl_offset, wqe_req);\n \n \twq-\u003ehead += wqe_size / GDMA_WQE_BU_SIZE;\n \n@@ -1653,11 +1803,10 @@ int mana_gd_post_and_ring(struct gdma_queue *queue,\n static int mana_gd_read_cqe(struct gdma_queue *cq, struct gdma_comp *comp)\n {\n \tunsigned int num_cqe = cq-\u003equeue_size / sizeof(struct gdma_cqe);\n-\tstruct gdma_cqe *cq_cqe = cq-\u003equeue_mem_ptr;\n \tu32 owner_bits, new_bits, old_bits;\n \tstruct gdma_cqe *cqe;\n \n-\tcqe = \u0026cq_cqe[cq-\u003ehead % num_cqe];\n+\tcqe = mana_gd_ring_ptr(cq, (cq-\u003ehead % num_cqe) * sizeof(*cqe));\n \towner_bits = cqe-\u003ecqe_info.owner_bits;\n \n \told_bits = (cq-\u003ehead / num_cqe - 1) \u0026 GDMA_CQE_OWNER_MASK;\ndiff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c\nindex e3c24d50dad07..263e7c4e29341 100644\n--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c\n+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c\n@@ -479,7 +479,7 @@ static int mana_hwc_alloc_dma_buf(struct hw_channel_context *hwc, u16 q_depth,\n \tbuf_size = MANA_PAGE_ALIGN(q_depth * max_msg_size);\n \n \tgmi = \u0026dma_buf-\u003emem_info;\n-\terr = mana_gd_alloc_memory(gc, buf_size, gmi);\n+\terr = mana_gd_alloc_memory(gc, buf_size, gmi, false);\n \tif (err) {\n \t\tdev_err(hwc-\u003edev, \"Failed to allocate DMA buffer size: %u, err %d\\n\",\n \t\t\tbuf_size, err);\ndiff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c\nindex 2519a98ad00b0..b803711968042 100644\n--- a/drivers/net/ethernet/microsoft/mana/mana_en.c\n+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c\n@@ -40,6 +40,9 @@ static ssize_t mana_dbg_q_read(struct file *filp, char __user *buf, size_t count\n {\n \tstruct gdma_queue *gdma_q = filp-\u003eprivate_data;\n \n+\tif (gdma_q-\u003emem_info.nr_pages)\n+\t\treturn mana_gd_read_ring(gdma_q, buf, count, pos);\n+\n \treturn simple_read_from_buffer(buf, count, pos, gdma_q-\u003equeue_mem_ptr,\n \t\t\t\t gdma_q-\u003equeue_size);\n }\ndiff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h\nindex 8529cef0d7c45..b0b322a80b629 100644\n--- a/include/net/mana/gdma.h\n+++ b/include/net/mana/gdma.h\n@@ -240,6 +240,14 @@ struct gdma_mem_info {\n \tvoid *virt_addr;\n \tu64 length;\n \n+\t/* Scattered fallback: when @nr_pages \u003e 0 the ring is that many\n+\t * PAGE_SIZE coherent allocations in @pages_va/@pages_dma, not\n+\t * @virt_addr/@dma_handle.\n+\t */\n+\tvoid **pages_va;\n+\tdma_addr_t *pages_dma;\n+\tunsigned int nr_pages;\n+\n \t/* Allocated by the PF driver */\n \tu64 dma_region_handle;\n };\n@@ -512,6 +520,9 @@ int mana_gd_poll_cq(struct gdma_queue *cq, struct gdma_comp *comp, int num_cqe);\n \n void mana_gd_ring_cq(struct gdma_queue *cq, u8 arm_bit);\n \n+ssize_t mana_gd_read_ring(struct gdma_queue *q, char __user *buf,\n+\t\t\t size_t count, loff_t *pos);\n+\n int mana_schedule_serv_work(struct gdma_context *gc, enum gdma_eqe_type type);\n \n void mana_gd_ring_dim(struct gdma_queue *cq, u32 mod_usec, bool mod_usec_vld,\n@@ -668,6 +679,9 @@ enum {\n /* Driver supports dynamic interrupt moderation - DIM */\n #define GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION BIT(28)\n \n+/* Driver supports non-contiguous queue buffers */\n+#define GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS BIT(30)\n+\n #define GDMA_DRV_CAP_FLAGS1 \\\n \t(GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \\\n \t GDMA_DRV_CAP_FLAG_1_NAPI_WKDONE_FIX | \\\n@@ -684,7 +698,8 @@ enum {\n \t GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY | \\\n \t GDMA_DRV_CAP_FLAG_1_HWC_TIMEOUT_RECOVERY | \\\n \t GDMA_DRV_CAP_FLAG_1_EQ_MSI_UNSHARE_MULTI_VPORT | \\\n-\t GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION)\n+\t GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION | \\\n+\t GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS)\n \n #define GDMA_DRV_CAP_FLAGS2 0\n \n@@ -1045,7 +1060,7 @@ void mana_gd_wq_ring_doorbell(struct gdma_context *gc,\n \t\t\t struct gdma_queue *queue);\n \n int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length,\n-\t\t\t struct gdma_mem_info *gmi);\n+\t\t\t struct gdma_mem_info *gmi, bool allow_scatter);\n \n void mana_gd_free_memory(struct gdma_mem_info *gmi);\n \n"
} |
| 2/1 | 2026/08/07 22:03 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the Microsoft Azure Network Adapter (MANA) driver, which is a vendor-specific PCIe device driver. This hardware is not emulated in standard QEMU or GCE environments used by syzkaller, making the code paths unreachable during standard fuzzing.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a '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: For your convenience, here is the diff of the changes:
commit bd8becd05b220ee4c0cc0f32d4182d58c256feea
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Aug 7 22:03:44 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index a38d4bb74621f..ed9af314e4ede 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -11,6 +11,7 @@
#include <linux/msi.h>
#include <linux/irqdomain.h>
#include <linux/export.h>
+#include <linux/uaccess.h>
#include <net/mana/mana.h>
#include <net/mana/hw_channel.h>
@@ -374,28 +375,96 @@ int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req,
EXPORT_SYMBOL_NS(mana_gd_send_request, "NET_MANA");
int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length,
- struct gdma_mem_info *gmi)
+ struct gdma_mem_info *gmi, bool allow_scatter)
{
+ unsigned int npages, i;
dma_addr_t dma_handle;
+ bool can_fallback;
void *buf;
if (length < MANA_PAGE_SIZE || !is_power_of_2(length))
return -EINVAL;
gmi->dev = gc->dev;
- buf = dma_alloc_coherent(gmi->dev, length, &dma_handle, GFP_KERNEL);
- if (!buf)
+
+ /* An allocation that fits in one page does not benefit from
+ * fallback.
+ */
+ can_fallback = allow_scatter && length > PAGE_SIZE;
+
+ /* Warn only when there is no fallback to rescue the failure. */
+ buf = dma_alloc_coherent(gmi->dev, length, &dma_handle,
+ GFP_KERNEL |
+ (can_fallback ? __GFP_NOWARN : 0));
+ if (buf) {
+ gmi->dma_handle = dma_handle;
+ gmi->virt_addr = buf;
+ gmi->length = length;
+ gmi->nr_pages = 0;
+ return 0;
+ }
+
+ if (!can_fallback)
return -ENOMEM;
- gmi->dma_handle = dma_handle;
- gmi->virt_addr = buf;
+ /* length is a power of 2 above PAGE_SIZE, so this divides exactly. */
+ npages = length / PAGE_SIZE;
+
+ gmi->pages_va = kvcalloc(npages, sizeof(*gmi->pages_va), GFP_KERNEL);
+ if (!gmi->pages_va)
+ return -ENOMEM;
+
+ gmi->pages_dma = kvcalloc(npages, sizeof(*gmi->pages_dma), GFP_KERNEL);
+ if (!gmi->pages_dma)
+ goto free_va;
+
+ for (i = 0; i < npages; i++) {
+ gmi->pages_va[i] = dma_alloc_coherent(gmi->dev, PAGE_SIZE,
+ &gmi->pages_dma[i],
+ GFP_KERNEL);
+ if (!gmi->pages_va[i])
+ goto free_pages;
+ }
+
+ dev_info_ratelimited(gmi->dev,
+ "contiguous %u-byte DMA alloc failed; using %u scattered pages\n",
+ length, npages);
+
+ gmi->virt_addr = NULL;
+ gmi->dma_handle = 0;
gmi->length = length;
+ gmi->nr_pages = npages;
return 0;
+
+free_pages:
+ while (i--)
+ dma_free_coherent(gmi->dev, PAGE_SIZE, gmi->pages_va[i],
+ gmi->pages_dma[i]);
+ kvfree(gmi->pages_dma);
+ gmi->pages_dma = NULL;
+free_va:
+ kvfree(gmi->pages_va);
+ gmi->pages_va = NULL;
+ return -ENOMEM;
}
void mana_gd_free_memory(struct gdma_mem_info *gmi)
{
+ unsigned int i;
+
+ if (gmi->nr_pages > 0) {
+ for (i = 0; i < gmi->nr_pages; i++)
+ dma_free_coherent(gmi->dev, PAGE_SIZE, gmi->pages_va[i],
+ gmi->pages_dma[i]);
+ kvfree(gmi->pages_va);
+ kvfree(gmi->pages_dma);
+ gmi->pages_va = NULL;
+ gmi->pages_dma = NULL;
+ gmi->nr_pages = 0;
+ return;
+ }
+
dma_free_coherent(gmi->dev, gmi->length, gmi->virt_addr,
gmi->dma_handle);
}
@@ -753,11 +822,73 @@ int mana_schedule_serv_work(struct gdma_context *gc, enum gdma_eqe_type type)
return 0;
}
+/* Return the CPU address of byte @offset within a queue's ring buffer. */
+static void *mana_gd_ring_ptr(const struct gdma_queue *q, u32 offset)
+{
+ const struct gdma_mem_info *gmi = &q->mem_info;
+
+ if (gmi->nr_pages > 0)
+ return (u8 *)gmi->pages_va[offset / PAGE_SIZE] +
+ (offset & (PAGE_SIZE - 1));
+
+ return q->queue_mem_ptr + offset;
+}
+
+/* Number of bytes from @offset to the end of the CPU-contiguous region: the
+ * rest of the ring, or the rest of the current page when scattered.
+ */
+static u32 mana_gd_ring_contig_avail(const struct gdma_queue *q, u32 offset)
+{
+ if (q->mem_info.nr_pages > 0)
+ return PAGE_SIZE - (offset & (PAGE_SIZE - 1));
+
+ return q->queue_size - offset;
+}
+
+/* Copy up to @count bytes from ring offset *@pos of @q into user buffer @buf,
+ * so a scattered ring reads back as if it were contiguous. Returns bytes
+ * copied, 0 at end of ring, or a negative errno.
+ */
+ssize_t mana_gd_read_ring(struct gdma_queue *q, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u32 size = q->queue_size;
+ loff_t off = *pos;
+ size_t copied = 0;
+
+ if (off < 0)
+ return -EINVAL;
+ if (off >= size || !count)
+ return 0;
+ count = min_t(size_t, count, size - off);
+
+ while (count) {
+ u32 offset = off;
+ u32 avail = mana_gd_ring_contig_avail(q, offset);
+ size_t chunk = min_t(size_t, count, avail);
+ size_t left = copy_to_user(buf, mana_gd_ring_ptr(q, offset),
+ chunk);
+
+ chunk -= left;
+ buf += chunk;
+ off += chunk;
+ copied += chunk;
+ count -= chunk;
+ if (left)
+ break;
+ }
+
+ if (!copied)
+ return -EFAULT;
+
+ *pos = off;
+ return copied;
+}
+
static void mana_gd_process_eqe(struct gdma_queue *eq)
{
u32 head = eq->head % (eq->queue_size / GDMA_EQE_SIZE);
struct gdma_context *gc = eq->gdma_dev->gdma_context;
- struct gdma_eqe *eq_eqe_ptr = eq->queue_mem_ptr;
union gdma_eqe_info eqe_info;
enum gdma_eqe_type type;
struct gdma_event event;
@@ -765,7 +896,7 @@ static void mana_gd_process_eqe(struct gdma_queue *eq)
struct gdma_eqe *eqe;
u32 cq_id;
- eqe = &eq_eqe_ptr[head];
+ eqe = mana_gd_ring_ptr(eq, head * sizeof(*eqe));
eqe_info.as_uint32 = eqe->eqe_info;
type = eqe_info.type;
@@ -829,7 +960,6 @@ static void mana_gd_process_eq_events(void *arg)
{
u32 owner_bits, new_bits, old_bits;
union gdma_eqe_info eqe_info;
- struct gdma_eqe *eq_eqe_ptr;
struct gdma_queue *eq = arg;
struct gdma_context *gc;
struct gdma_eqe *eqe;
@@ -839,11 +969,10 @@ static void mana_gd_process_eq_events(void *arg)
gc = eq->gdma_dev->gdma_context;
num_eqe = eq->queue_size / GDMA_EQE_SIZE;
- eq_eqe_ptr = eq->queue_mem_ptr;
/* Process up to 5 EQEs at a time, and update the HW head. */
for (i = 0; i < 5; i++) {
- eqe = &eq_eqe_ptr[eq->head % num_eqe];
+ eqe = mana_gd_ring_ptr(eq, (eq->head % num_eqe) * sizeof(*eqe));
eqe_info.as_uint32 = eqe->eqe_info;
owner_bits = eqe_info.owner_bits;
@@ -1107,7 +1236,7 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd,
return -ENOMEM;
gmi = &queue->mem_info;
- err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
+ err = mana_gd_alloc_memory(gc, spec->queue_size, gmi, false);
if (err) {
dev_err(gc->dev, "GDMA queue type: %d, size: %u, gdma memory allocation err: %d\n",
spec->type, spec->queue_size, err);
@@ -1182,7 +1311,7 @@ static int mana_gd_create_dma_region(struct gdma_dev *gd,
if (length < MANA_PAGE_SIZE || !is_power_of_2(length))
return -EINVAL;
- if (!MANA_PAGE_ALIGNED(gmi->virt_addr))
+ if (gmi->nr_pages == 0 && !MANA_PAGE_ALIGNED(gmi->virt_addr))
return -EINVAL;
hwc = gc->hwc.driver_data;
@@ -1202,8 +1331,24 @@ static int mana_gd_create_dma_region(struct gdma_dev *gd,
req->page_count = num_page;
req->page_addr_list_len = num_page;
- for (i = 0; i < num_page; i++)
- req->page_addr_list[i] = gmi->dma_handle + i * MANA_PAGE_SIZE;
+ if (gmi->nr_pages > 0) {
+ unsigned int subpages = PAGE_SIZE / MANA_PAGE_SIZE;
+ unsigned int idx = 0;
+ unsigned int pg, sub;
+
+ /* Each PAGE_SIZE chunk is physically contiguous and contains
+ * PAGE_SIZE / MANA_PAGE_SIZE consecutive device pages.
+ */
+ for (pg = 0; pg < gmi->nr_pages; pg++)
+ for (sub = 0; sub < subpages; sub++)
+ req->page_addr_list[idx++] =
+ gmi->pages_dma[pg] +
+ sub * MANA_PAGE_SIZE;
+ } else {
+ for (i = 0; i < num_page; i++)
+ req->page_addr_list[i] =
+ gmi->dma_handle + i * MANA_PAGE_SIZE;
+ }
err = mana_gd_send_request(gc, req_msg_size, req, sizeof(resp), &resp);
if (err)
@@ -1246,7 +1391,7 @@ int mana_gd_create_mana_eq(struct gdma_dev *gd,
return -ENOMEM;
gmi = &queue->mem_info;
- err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
+ err = mana_gd_alloc_memory(gc, spec->queue_size, gmi, true);
if (err) {
dev_err(gc->dev, "GDMA queue type: %d, size: %u, gdma memory allocation err: %d\n",
spec->type, spec->queue_size, err);
@@ -1301,7 +1446,7 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd,
queue->id = INVALID_QUEUE_ID;
gmi = &queue->mem_info;
- err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
+ err = mana_gd_alloc_memory(gc, spec->queue_size, gmi, true);
if (err) {
dev_err(gc->dev, "GDMA queue type: %d, size: %u, memory allocation err: %d\n",
spec->type, spec->queue_size, err);
@@ -1508,7 +1653,7 @@ u8 *mana_gd_get_wqe_ptr(const struct gdma_queue *wq, u32 wqe_offset)
WARN_ON_ONCE((offset + GDMA_WQE_BU_SIZE) > wq->queue_size);
- return wq->queue_mem_ptr + offset;
+ return mana_gd_ring_ptr(wq, offset);
}
static u32 mana_gd_write_client_oob(const struct gdma_wqe_request *wqe_req,
@@ -1554,27 +1699,24 @@ static u32 mana_gd_write_client_oob(const struct gdma_wqe_request *wqe_req,
return sizeof(header) + client_oob_size;
}
-static void mana_gd_write_sgl(struct gdma_queue *wq, u8 *wqe_ptr,
+static void mana_gd_write_sgl(struct gdma_queue *wq, u32 sgl_offset,
const struct gdma_wqe_request *wqe_req)
{
+ u32 size_to_end = mana_gd_ring_contig_avail(wq, sgl_offset);
u32 sgl_size = sizeof(struct gdma_sge) * wqe_req->num_sge;
const u8 *address = (u8 *)wqe_req->sgl;
- u8 *base_ptr, *end_ptr;
- u32 size_to_end;
-
- base_ptr = wq->queue_mem_ptr;
- end_ptr = base_ptr + wq->queue_size;
- size_to_end = (u32)(end_ptr - wqe_ptr);
if (size_to_end < sgl_size) {
- memcpy(wqe_ptr, address, size_to_end);
+ memcpy(mana_gd_ring_ptr(wq, sgl_offset), address, size_to_end);
- wqe_ptr = base_ptr;
address += size_to_end;
sgl_size -= size_to_end;
+ sgl_offset += size_to_end;
+ if (sgl_offset == wq->queue_size)
+ sgl_offset = 0;
}
- memcpy(wqe_ptr, address, sgl_size);
+ memcpy(mana_gd_ring_ptr(wq, sgl_offset), address, sgl_size);
}
int mana_gd_post_work_request(struct gdma_queue *wq,
@@ -1584,8 +1726,12 @@ int mana_gd_post_work_request(struct gdma_queue *wq,
u32 client_oob_size = wqe_req->inline_oob_size;
u32 sgl_data_size;
u32 max_wqe_size;
+ u32 wqe_offset;
+ u32 sgl_offset;
u32 wqe_size;
+ u32 oob_len;
u8 *wqe_ptr;
+ u32 head;
if (wqe_req->num_sge == 0)
return -EINVAL;
@@ -1617,13 +1763,17 @@ int mana_gd_post_work_request(struct gdma_queue *wq,
if (wqe_info)
wqe_info->wqe_size_in_bu = wqe_size / GDMA_WQE_BU_SIZE;
- wqe_ptr = mana_gd_get_wqe_ptr(wq, wq->head);
- wqe_ptr += mana_gd_write_client_oob(wqe_req, wq->type, client_oob_size,
- sgl_data_size, wqe_ptr);
- if (wqe_ptr >= (u8 *)wq->queue_mem_ptr + wq->queue_size)
- wqe_ptr -= wq->queue_size;
+ head = wq->head;
+ wqe_offset = (head * GDMA_WQE_BU_SIZE) & (wq->queue_size - 1);
+ wqe_ptr = mana_gd_get_wqe_ptr(wq, head);
+ oob_len = mana_gd_write_client_oob(wqe_req, wq->type, client_oob_size,
+ sgl_data_size, wqe_ptr);
+
+ sgl_offset = wqe_offset + oob_len;
+ if (sgl_offset >= wq->queue_size)
+ sgl_offset -= wq->queue_size;
- mana_gd_write_sgl(wq, wqe_ptr, wqe_req);
+ mana_gd_write_sgl(wq, sgl_offset, wqe_req);
wq->head += wqe_size / GDMA_WQE_BU_SIZE;
@@ -1653,11 +1803,10 @@ int mana_gd_post_and_ring(struct gdma_queue *queue,
static int mana_gd_read_cqe(struct gdma_queue *cq, struct gdma_comp *comp)
{
unsigned int num_cqe = cq->queue_size / sizeof(struct gdma_cqe);
- struct gdma_cqe *cq_cqe = cq->queue_mem_ptr;
u32 owner_bits, new_bits, old_bits;
struct gdma_cqe *cqe;
- cqe = &cq_cqe[cq->head % num_cqe];
+ cqe = mana_gd_ring_ptr(cq, (cq->head % num_cqe) * sizeof(*cqe));
owner_bits = cqe->cqe_info.owner_bits;
old_bits = (cq->head / num_cqe - 1) & GDMA_CQE_OWNER_MASK;
diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
index e3c24d50dad07..263e7c4e29341 100644
--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
@@ -479,7 +479,7 @@ static int mana_hwc_alloc_dma_buf(struct hw_channel_context *hwc, u16 q_depth,
buf_size = MANA_PAGE_ALIGN(q_depth * max_msg_size);
gmi = &dma_buf->mem_info;
- err = mana_gd_alloc_memory(gc, buf_size, gmi);
+ err = mana_gd_alloc_memory(gc, buf_size, gmi, false);
if (err) {
dev_err(hwc->dev, "Failed to allocate DMA buffer size: %u, err %d\n",
buf_size, err);
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 2519a98ad00b0..b803711968042 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -40,6 +40,9 @@ static ssize_t mana_dbg_q_read(struct file *filp, char __user *buf, size_t count
{
struct gdma_queue *gdma_q = filp->private_data;
+ if (gdma_q->mem_info.nr_pages)
+ return mana_gd_read_ring(gdma_q, buf, count, pos);
+
return simple_read_from_buffer(buf, count, pos, gdma_q->queue_mem_ptr,
gdma_q->queue_size);
}
diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
index 8529cef0d7c45..b0b322a80b629 100644
--- a/include/net/mana/gdma.h
+++ b/include/net/mana/gdma.h
@@ -240,6 +240,14 @@ struct gdma_mem_info {
void *virt_addr;
u64 length;
+ /* Scattered fallback: when @nr_pages > 0 the ring is that many
+ * PAGE_SIZE coherent allocations in @pages_va/@pages_dma, not
+ * @virt_addr/@dma_handle.
+ */
+ void **pages_va;
+ dma_addr_t *pages_dma;
+ unsigned int nr_pages;
+
/* Allocated by the PF driver */
u64 dma_region_handle;
};
@@ -512,6 +520,9 @@ int mana_gd_poll_cq(struct gdma_queue *cq, struct gdma_comp *comp, int num_cqe);
void mana_gd_ring_cq(struct gdma_queue *cq, u8 arm_bit);
+ssize_t mana_gd_read_ring(struct gdma_queue *q, char __user *buf,
+ size_t count, loff_t *pos);
+
int mana_schedule_serv_work(struct gdma_context *gc, enum gdma_eqe_type type);
void mana_gd_ring_dim(struct gdma_queue *cq, u32 mod_usec, bool mod_usec_vld,
@@ -668,6 +679,9 @@ enum {
/* Driver supports dynamic interrupt moderation - DIM */
#define GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION BIT(28)
+/* Driver supports non-contiguous queue buffers */
+#define GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS BIT(30)
+
#define GDMA_DRV_CAP_FLAGS1 \
(GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \
GDMA_DRV_CAP_FLAG_1_NAPI_WKDONE_FIX | \
@@ -684,7 +698,8 @@ enum {
GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY | \
GDMA_DRV_CAP_FLAG_1_HWC_TIMEOUT_RECOVERY | \
GDMA_DRV_CAP_FLAG_1_EQ_MSI_UNSHARE_MULTI_VPORT | \
- GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION)
+ GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION | \
+ GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS)
#define GDMA_DRV_CAP_FLAGS2 0
@@ -1045,7 +1060,7 @@ void mana_gd_wq_ring_doorbell(struct gdma_context *gc,
struct gdma_queue *queue);
int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length,
- struct gdma_mem_info *gmi);
+ struct gdma_mem_info *gmi, bool allow_scatter);
void mana_gd_free_memory(struct gdma_mem_info *gmi);
|
| 3/2 | 2026/08/07 22:03 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8609 output: 21 thoughts: 390 Thoughts: **Analyzing the Fuzzing Potential of This MANA Driver Patch** Okay, so I'm looking at a patch that touches `gdma_main.c`, `hw_channel.c`, `mana_en.c`, and `gdma.h` – all within the MANA driver, which seems to be the Microsoft Azure Network Adapter. It's adding support for scattered fallback memory allocation, which is interesting in itself. But here's the crucial question: is this patch worth fuzzing, based on the specific criteria? Let's see, the instructions state that a patch isn't worth fuzzing if it's got code that's unreachable in virtualized environments like QEMU or relies on specialized hardware. So, my initial thought is, MANA is a virtualized network driver, used in Azure, specifically Hyper-V, and I'm pretty sure it doesn't run in standard QEMU. That's a red flag. But wait, can Hyper-V guests run in QEMU? Hmm, not with this MANA hardware, it's a specific Azure SR-IOV adapter. It's an Azure-specific hardware. So, MANA is vendor-specific, but not a SmartNIC or GPU driver like the criteria describe, and I'm certain it isn't emulated in standard QEMU. It is a PCI device, specifically the Microsoft Azure Network Adapter. Can syzkaller even touch it? Syzkaller runs in QEMU/GCE, right? And it sure doesn't have MANA hardware... that's a problem. Syzkaller doesn't emulate MANA. This looks like a definite no-go for standard fuzzing. Just to be absolutely sure, I'll quickly double-check if the MANA code is reachable, or dependent on any specific hardware that makes it inaccessible to the standard fuzzing environment. A quick `mana` search in the kernel should provide confirmation. |
| 4/2 | 2026/08/07 22:03 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_MICROSOFT_MANA"
}Results: {
"Output": "drivers/net/ethernet/microsoft/Makefile-4-\ndrivers/net/ethernet/microsoft/Makefile:5:obj-$(CONFIG_MICROSOFT_MANA) += mana/\n--\ndrivers/net/ethernet/microsoft/mana/Makefile-4-\ndrivers/net/ethernet/microsoft/mana/Makefile:5:obj-$(CONFIG_MICROSOFT_MANA) += mana.o\ndrivers/net/ethernet/microsoft/mana/Makefile-6-mana-objs := gdma_main.o shm_channel.o hw_channel.o mana_en.o mana_ethtool.o mana_bpf.o\n"
} |
| 5/2 | 2026/08/07 22:03 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9592 output: 35 thoughts: 65 Thoughts: **Analyzing the Reachability of Code Paths in the MANA Driver** Okay, hold on a second. I need to rethink this. It just hit me: syzkaller, as far as I understand it, doesn't actually emulate the MANA PCI devices. That presents a serious hurdle. I was assuming it could, but now I'm questioning the basis of my initial thought process. So, if syzkaller isn't our route in, how *else* can we exercise this specific code? The driver's architecture leans on being a PCI driver, which means it should be loaded and managed through the PCI subsystem. I need to confirm if there are alternative entry points beyond the simulated environment. To start, let me quickly pivot to `drivers/net/ethernet/microsoft/mana/gdma_main.c` and specifically look for references to `pci_driver`. This should provide crucial insights. By examining how the driver registers with and interacts with the PCI bus, I can get a better grip on whether this code is even remotely reachable given our current constraints. |
| 6/2 | 2026/08/07 22:03 | tool | grepper |
0mArgs:{
"Expression": "pci_driver",
"PathPrefix": "drivers/net/ethernet/microsoft/mana/"
}Results: {
"Output": "drivers/net/ethernet/microsoft/mana/gdma_main.c=2700=static const struct pci_device_id mana_id_table[] = {\n--\ndrivers/net/ethernet/microsoft/mana/gdma_main.c-2706-\ndrivers/net/ethernet/microsoft/mana/gdma_main.c:2707:static struct pci_driver mana_driver = {\ndrivers/net/ethernet/microsoft/mana/gdma_main.c-2708-\t.name\t\t= \"mana\",\n"
} |
| 7/2 | 2026/08/07 22:03 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 10064 output: 86 thoughts: 243 Thoughts: **My Assessment: MANA Driver Fuzzing Infeasibility** Okay, let's think this through. This is a PCI driver specifically for the Microsoft Azure Network Adapter, MANA. And from what I understand, it's not something you can just spin up and play with in a standard QEMU or GCE environment. It's a vendor-specific piece of hardware that necessitates actual, physical PCIe hardware, or at least a very specialized emulation. Given that, this immediately screams "WorthFuzzing=false". I need to keep in mind the instructions for evaluating the patch: am I dealing with code impossible to touch in a virtualized environment – even if that environment has clever software-emulated hardware. It seems like a lot of the examples were PCI-based and/or SmartNIC's - similar to my current situation. I've gone through the guidelines, and it's clear: vendor-specific PCIe drivers like MANA – designed for physical hardware that QEMU doesn't, and probably *can't*, emulate – are exactly the category that disqualifies it. The MANA driver is the same; it's hardware-dependent, so I need to set the fuzzing flag to false. I will mark it as such. |
| 8/2 | 2026/08/07 22:04 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies the Microsoft Azure Network Adapter (MANA) driver, which is a vendor-specific PCIe device driver. This hardware is not emulated in standard QEMU or GCE environments used by syzkaller, making the code paths unreachable during standard fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the Microsoft Azure Network Adapter (MANA) driver, which is a vendor-specific PCIe device driver. This hardware is not emulated in standard QEMU or GCE environments used by syzkaller, making the code paths unreachable during standard fuzzing.",
"WorthFuzzing": false
} |
| 9/1 | 2026/08/07 22:04 | 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) |
|---|