| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/03 03:59 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch only performs cosmetic refactoring of register bitmask macros in the Realtek RTL8365MB switch driver, converting raw hex constants to BIT() and GENMASK() without modifying any executable C logic or runtime behavior. Furthermore, the driver targets physical Realtek switch ASICs (connected via SMI/MDIO) that are structurally unreachable in standard virtualized fuzzing environments.",
"WorthFuzzing": false
} |
| 1/1 | 2026/10/03 03:59 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 8aab3b48e9cd0a206d3387b15d7141f83c7e0f98\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Oct 3 03:59:05 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c\nindex 87ec924a06118..da06f952a053d 100644\n--- a/drivers/net/dsa/realtek/rtl8365mb_main.c\n+++ b/drivers/net/dsa/realtek/rtl8365mb_main.c\n@@ -132,32 +132,32 @@\n #define RTL8365MB_MAGIC_VALUE\t\t0x0249\n \n /* Chip reset register */\n-#define RTL8365MB_CHIP_RESET_REG\t0x1322\n-#define RTL8365MB_CHIP_RESET_DW8051_MASK\t0x0010\n-#define RTL8365MB_CHIP_RESET_SW_MASK\t0x0002\n-#define RTL8365MB_CHIP_RESET_HW_MASK\t0x0001\n+#define RTL8365MB_CHIP_RESET_REG\t\t0x1322\n+#define RTL8365MB_CHIP_RESET_DW8051_MASK\tBIT(4)\n+#define RTL8365MB_CHIP_RESET_SW_MASK\t\tBIT(1)\n+#define RTL8365MB_CHIP_RESET_HW_MASK\t\tBIT(0)\n \n /* Interrupt polarity register */\n #define RTL8365MB_INTR_POLARITY_REG\t0x1100\n-#define RTL8365MB_INTR_POLARITY_MASK\t0x0001\n+#define RTL8365MB_INTR_POLARITY_MASK\tBIT(0)\n #define RTL8365MB_INTR_POLARITY_HIGH\t0\n #define RTL8365MB_INTR_POLARITY_LOW\t1\n \n /* Interrupt control/status register - enable/check specific interrupt types */\n #define RTL8365MB_INTR_CTRL_REG\t\t\t0x1101\n-#define RTL8365MB_INTR_STATUS_REG\t\t0x1102\n-#define RTL8365MB_INTR_SLIENT_START_2_MASK\t0x1000\n-#define RTL8365MB_INTR_SLIENT_START_MASK\t0x0800\n-#define RTL8365MB_INTR_ACL_ACTION_MASK\t0x0200\n-#define RTL8365MB_INTR_CABLE_DIAG_FIN_MASK\t0x0100\n-#define RTL8365MB_INTR_INTERRUPT_8051_MASK\t0x0080\n-#define RTL8365MB_INTR_LOOP_DETECTION_MASK\t0x0040\n-#define RTL8365MB_INTR_GREEN_TIMER_MASK\t0x0020\n-#define RTL8365MB_INTR_SPECIAL_CONGEST_MASK\t0x0010\n-#define RTL8365MB_INTR_SPEED_CHANGE_MASK\t0x0008\n-#define RTL8365MB_INTR_LEARN_OVER_MASK\t0x0004\n-#define RTL8365MB_INTR_METER_EXCEEDED_MASK\t0x0002\n-#define RTL8365MB_INTR_LINK_CHANGE_MASK\t0x0001\n+#define RTL8365MB_INTR_STATUS_REG\t\t0x1102\n+#define RTL8365MB_INTR_SLIENT_START_2_MASK\tBIT(12)\n+#define RTL8365MB_INTR_SLIENT_START_MASK\tBIT(11)\n+#define RTL8365MB_INTR_ACL_ACTION_MASK\tBIT(9)\n+#define RTL8365MB_INTR_CABLE_DIAG_FIN_MASK\tBIT(8)\n+#define RTL8365MB_INTR_INTERRUPT_8051_MASK\tBIT(7)\n+#define RTL8365MB_INTR_LOOP_DETECTION_MASK\tBIT(6)\n+#define RTL8365MB_INTR_GREEN_TIMER_MASK\tBIT(5)\n+#define RTL8365MB_INTR_SPECIAL_CONGEST_MASK\tBIT(4)\n+#define RTL8365MB_INTR_SPEED_CHANGE_MASK\tBIT(3)\n+#define RTL8365MB_INTR_LEARN_OVER_MASK\tBIT(2)\n+#define RTL8365MB_INTR_METER_EXCEEDED_MASK\tBIT(1)\n+#define RTL8365MB_INTR_LINK_CHANGE_MASK\tBIT(0)\n #define RTL8365MB_INTR_ALL_MASK \\\n \t\t(RTL8365MB_INTR_SLIENT_START_2_MASK | \\\n \t\t RTL8365MB_INTR_SLIENT_START_MASK | \\\n@@ -172,20 +172,22 @@\n \t\t RTL8365MB_INTR_METER_EXCEEDED_MASK | \\\n \t\t RTL8365MB_INTR_LINK_CHANGE_MASK)\n \n+#define RTL8365MB_PORT_MASK\t\t\tGENMASK(10, 0)\n+\n /* Per-port interrupt type status registers */\n #define RTL8365MB_PORT_LINKDOWN_IND_REG\t\t0x1106\n-#define RTL8365MB_PORT_LINKDOWN_IND_MASK\t0x07FF\n+#define RTL8365MB_PORT_LINKDOWN_IND_MASK\tRTL8365MB_PORT_MASK\n \n #define RTL8365MB_PORT_LINKUP_IND_REG\t\t0x1107\n-#define RTL8365MB_PORT_LINKUP_IND_MASK\t0x07FF\n+#define RTL8365MB_PORT_LINKUP_IND_MASK\tRTL8365MB_PORT_MASK\n \n /* PHY indirect access registers */\n #define RTL8365MB_INDIRECT_ACCESS_CTRL_REG\t\t\t0x1F00\n-#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_MASK\t\t0x0002\n-#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_READ\t\t0\n-#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_WRITE\t\t1\n-#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_MASK\t\t0x0001\n-#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_VALUE\t\t1\n+#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_MASK\t\tBIT(1)\n+#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_READ\t\t0\n+#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_WRITE\t\t1\n+#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_MASK\t\tBIT(0)\n+#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_VALUE\t\t1\n #define RTL8365MB_INDIRECT_ACCESS_STATUS_REG\t\t\t0x1F01\n #define RTL8365MB_INDIRECT_ACCESS_ADDRESS_REG\t\t\t0x1F02\n #define RTL8365MB_INDIRECT_ACCESS_ADDRESS_OCPADR_5_1_MASK\tGENMASK(4, 0)\n@@ -197,8 +199,8 @@\n \n /* PHY OCP address prefix register */\n #define RTL8365MB_GPHY_OCP_MSB_0_REG\t\t\t0x1D15\n-#define RTL8365MB_GPHY_OCP_MSB_0_CFG_CPU_OCPADR_MASK\t0x0FC0\n-#define RTL8365MB_PHY_OCP_ADDR_PREFIX_MASK\t\t0xFC00\n+#define RTL8365MB_GPHY_OCP_MSB_0_CFG_CPU_OCPADR_MASK\tGENMASK(11, 6)\n+#define RTL8365MB_PHY_OCP_ADDR_PREFIX_MASK\t\tGENMASK(15, 10)\n \n /* The full 16-bit OCP address is split across two registers: bits [15:10] are\n * the prefix (RTL8365MB_PHY_OCP_ADDR_PREFIX_MASK above), and bits [9:1] go into\n@@ -252,8 +254,8 @@\n \t\t (_extint) == 1 ? RTL8365MB_EXT_RGMXF_REG1 : \\\n \t\t (_extint) == 2 ? RTL8365MB_EXT_RGMXF_REG2 : \\\n \t\t 0x0)\n-#define RTL8365MB_EXT_RGMXF_RXDELAY_MASK\t0x0007\n-#define RTL8365MB_EXT_RGMXF_TXDELAY_MASK\t0x0008\n+#define RTL8365MB_EXT_RGMXF_RXDELAY_MASK\tGENMASK(2, 0)\n+#define RTL8365MB_EXT_RGMXF_TXDELAY_MASK\tBIT(3)\n \n /* External interface line rate bypass register - one bit per external\n * interface, indexed by the external port number with port 5 (the first\n@@ -271,28 +273,28 @@\n */\n #define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL0_REG\t0x00CF\n #define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL1_REG\t0x00D0\n-#define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL1_MASK\t0x0007\n+#define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL1_MASK\tGENMASK(2, 0)\n #define RTL8365MB_PORT6_EGRESSBW_CTRL0_REG\t\t0x0398\n #define RTL8365MB_PORT6_EGRESSBW_CTRL1_REG\t\t0x0399\n-#define RTL8365MB_PORT6_EGRESSBW_CTRL1_MASK\t\t0x0007\n+#define RTL8365MB_PORT6_EGRESSBW_CTRL1_MASK\t\tGENMASK(2, 0)\n \n /* SerDes indirect access registers */\n #define RTL8365MB_SDS_INDACS_CMD_REG\t\t0x6600\n-#define RTL8365MB_SDS_INDACS_CMD_BUSY_MASK\t0x0100\n-#define RTL8365MB_SDS_INDACS_CMD_RUN_MASK\t0x0080\n-#define RTL8365MB_SDS_INDACS_CMD_WR_MASK\t0x0040\n+#define RTL8365MB_SDS_INDACS_CMD_BUSY_MASK\tBIT(8)\n+#define RTL8365MB_SDS_INDACS_CMD_RUN_MASK\tBIT(7)\n+#define RTL8365MB_SDS_INDACS_CMD_WR_MASK\tBIT(6)\n #define RTL8365MB_SDS_INDACS_ADR_REG\t\t0x6601\n #define RTL8365MB_SDS_INDACS_DATA_REG\t\t0x6602\n \n /* SerDes miscellaneous configuration register */\n #define RTL8365MB_SDS_MISC_REG\t\t\t\t0x1D11\n-#define RTL8365MB_SDS_MISC_SGMII_RXFC_MASK\t\t0x4000\n-#define RTL8365MB_SDS_MISC_SGMII_TXFC_MASK\t\t0x2000\n-#define RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK\t0x0800\n-#define RTL8365MB_SDS_MISC_SGMII_FDUP_MASK\t\t0x0400\n-#define RTL8365MB_SDS_MISC_SGMII_LINK_MASK\t\t0x0200\n-#define RTL8365MB_SDS_MISC_SGMII_SPD_MASK\t\t0x0180\n-#define RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK\t0x0040\n+#define RTL8365MB_SDS_MISC_SGMII_RXFC_MASK\t\tBIT(14)\n+#define RTL8365MB_SDS_MISC_SGMII_TXFC_MASK\t\tBIT(13)\n+#define RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK\tBIT(11)\n+#define RTL8365MB_SDS_MISC_SGMII_FDUP_MASK\t\tBIT(10)\n+#define RTL8365MB_SDS_MISC_SGMII_LINK_MASK\t\tBIT(9)\n+#define RTL8365MB_SDS_MISC_SGMII_SPD_MASK\t\tGENMASK(8, 7)\n+#define RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK\tBIT(6)\n \n /* SerDes internal registers, accessed via the SDS_INDACS registers. The BMCR\n * data path reset holds BMCR_ANENABLE | BMCR_ISOLATE while toggling the\n@@ -303,12 +305,12 @@\n #define RTL8365MB_SDS_BMCR_DPRST_PHASE1\t(BMCR_ANENABLE | BMCR_ISOLATE | 0x1)\n #define RTL8365MB_SDS_BMCR_DPRST_PHASE2\t(BMCR_ANENABLE | BMCR_ISOLATE | 0x3)\n #define RTL8365MB_SDS_REG_NWAY\t\t\t0x0002\n-#define RTL8365MB_SDS_NWAY_EN_MASK\t\t0x0200\n-#define RTL8365MB_SDS_NWAY_RESTART_MASK\t0x0100\n+#define RTL8365MB_SDS_NWAY_EN_MASK\t\tBIT(9)\n+#define RTL8365MB_SDS_NWAY_RESTART_MASK\tBIT(8)\n #define RTL8365MB_SDS_REG_RESET\t\t\t0x0003\n #define RTL8365MB_SDS_RESET_DEASSERT\t\t0x7106\n #define RTL8365MB_SDS_REG_LINK_STATUS\t\t0x003d\n-#define RTL8365MB_SDS_LINK_STATUS_LINK_MASK\t0x0010\n+#define RTL8365MB_SDS_LINK_STATUS_LINK_MASK\tBIT(4)\n \n /* The embedded SerDes can only be muxed to external interface 1 (MAC8),\n * which is port 6.\n@@ -335,7 +337,7 @@\n * the firmware would otherwise do.\n */\n #define RTL8365MB_MISC_CFG0_REG\t\t\t0x130C\n-#define RTL8365MB_MISC_CFG0_DW8051_EN_MASK\t0x0020\n+#define RTL8365MB_MISC_CFG0_DW8051_EN_MASK\tBIT(5)\n \n /* External interface port speed values - used in DIGITAL_INTERFACE_FORCE */\n #define RTL8365MB_PORT_SPEED_10M\t0\n@@ -351,31 +353,31 @@\n \t\t (_extint) == 1 ? RTL8365MB_DIGITAL_INTERFACE_FORCE_REG1 : \\\n \t\t (_extint) == 2 ? RTL8365MB_DIGITAL_INTERFACE_FORCE_REG2 : \\\n \t\t 0x0)\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_EN_MASK\t\t0x1000\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_NWAY_MASK\t\t0x0080\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_TXPAUSE_MASK\t0x0040\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_RXPAUSE_MASK\t0x0020\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_LINK_MASK\t\t0x0010\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_DUPLEX_MASK\t\t0x0004\n-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK\t\t0x0003\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_EN_MASK\t\tBIT(12)\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_NWAY_MASK\t\tBIT(7)\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_TXPAUSE_MASK\tBIT(6)\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_RXPAUSE_MASK\tBIT(5)\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_LINK_MASK\t\tBIT(4)\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_DUPLEX_MASK\t\tBIT(2)\n+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK\t\tGENMASK(1, 0)\n \n /* CPU port mask register - controls which ports are treated as CPU ports */\n #define RTL8365MB_CPU_PORT_MASK_REG\t0x1219\n-#define RTL8365MB_CPU_PORT_MASK_MASK\t0x07FF\n+#define RTL8365MB_CPU_PORT_MASK_MASK\tRTL8365MB_PORT_MASK\n \n /* CPU control register */\n #define RTL8365MB_CPU_CTRL_REG\t\t\t0x121A\n-#define RTL8365MB_CPU_CTRL_TRAP_PORT_EXT_MASK\t0x0400\n-#define RTL8365MB_CPU_CTRL_TAG_FORMAT_MASK\t0x0200\n-#define RTL8365MB_CPU_CTRL_RXBYTECOUNT_MASK\t0x0080\n-#define RTL8365MB_CPU_CTRL_TAG_POSITION_MASK\t0x0040\n-#define RTL8365MB_CPU_CTRL_TRAP_PORT_MASK\t0x0038\n-#define RTL8365MB_CPU_CTRL_INSERTMODE_MASK\t0x0006\n-#define RTL8365MB_CPU_CTRL_EN_MASK\t\t0x0001\n+#define RTL8365MB_CPU_CTRL_TRAP_PORT_EXT_MASK\tBIT(10)\n+#define RTL8365MB_CPU_CTRL_TAG_FORMAT_MASK\tBIT(9)\n+#define RTL8365MB_CPU_CTRL_RXBYTECOUNT_MASK\tBIT(7)\n+#define RTL8365MB_CPU_CTRL_TAG_POSITION_MASK\tBIT(6)\n+#define RTL8365MB_CPU_CTRL_TRAP_PORT_MASK\tGENMASK(5, 3)\n+#define RTL8365MB_CPU_CTRL_INSERTMODE_MASK\tGENMASK(2, 1)\n+#define RTL8365MB_CPU_CTRL_EN_MASK\t\tBIT(0)\n \n /* Maximum packet length register */\n #define RTL8365MB_CFG0_MAX_LEN_REG\t0x088C\n-#define RTL8365MB_CFG0_MAX_LEN_MASK\t0x3FFF\n+#define RTL8365MB_CFG0_MAX_LEN_MASK\tGENMASK(13, 0)\n #define RTL8365MB_CFG0_MAX_LEN_MAX\t0x3FFF\n \n /* Port learning limit registers */\n@@ -387,7 +389,7 @@\n #define RTL8365MB_PORT_ISOLATION_REG_BASE\t\t0x08A2\n #define RTL8365MB_PORT_ISOLATION_REG(_physport) \\\n \t\t(RTL8365MB_PORT_ISOLATION_REG_BASE + (_physport))\n-#define RTL8365MB_PORT_ISOLATION_MASK\t\t\t0x07FF\n+#define RTL8365MB_PORT_ISOLATION_MASK\t\t\tRTL8365MB_PORT_MASK\n \n /* Extended filter ID registers - used to key forwarding database with IVL */\n #define RTL8365MB_EFID_MASK\t\t\tGENMASK(2, 0)\n@@ -407,16 +409,16 @@\n \t\t(0x3 \u003c\u003c RTL8365MB_MSTI_CTRL_PORT_STATE_OFFSET((_physport)))\n \n /* Unknown unicast DA flooding port mask */\n-#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_REG\t\t0x0890\n-#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_MASK\t\t0x07FF\n+#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_REG\t0x0890\n+#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_MASK\tRTL8365MB_PORT_MASK\n \n /* Unknown multicast DA flooding port mask */\n-#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_REG\t\t0x0891\n-#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_MASK\t0x07FF\n+#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_REG\t 0x0891\n+#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_MASK RTL8365MB_PORT_MASK\n \n /* Broadcast flooding port mask */\n-#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_REG\t\t0x0892\n-#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_MASK\t0x07FF\n+#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_REG\t 0x0892\n+#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_MASK RTL8365MB_PORT_MASK\n \n #define RTL8365MB_SUPPORTED_BRIDGE_FLAGS \\\n \t (BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD | BR_BCAST_FLOOD)\n@@ -425,19 +427,19 @@\n #define RTL8365MB_PORT_MISC_CFG_REG_BASE\t\t\t0x000E\n #define RTL8365MB_PORT_MISC_CFG_REG(_p) \\\n \t\t(RTL8365MB_PORT_MISC_CFG_REG_BASE + ((_p) \u003c\u003c 5))\n-#define RTL8365MB_PORT_MISC_CFG_SMALL_TAG_IPG_MASK\t\t0x8000\n-#define RTL8365MB_PORT_MISC_CFG_TX_ITFSP_MODE_MASK\t\t0x4000\n-#define RTL8365MB_PORT_MISC_CFG_FLOWCTRL_INDEP_MASK\t\t0x2000\n-#define RTL8365MB_PORT_MISC_CFG_DOT1Q_REMARK_ENABLE_MASK\t0x1000\n-#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_FLOWCTRL_MASK\t0x0800\n-#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_IFG_MASK\t\t0x0400\n-#define RTL8365MB_PORT_MISC_CFG_RX_SPC_MASK\t\t\t0x0200\n-#define RTL8365MB_PORT_MISC_CFG_CRC_SKIP_MASK\t\t\t0x0100\n-#define RTL8365MB_PORT_MISC_CFG_PKTGEN_TX_FIRST_MASK\t\t0x0080\n-#define RTL8365MB_PORT_MISC_CFG_MAC_LOOPBACK_MASK\t\t0x0040\n+#define RTL8365MB_PORT_MISC_CFG_SMALL_TAG_IPG_MASK\t\tBIT(15)\n+#define RTL8365MB_PORT_MISC_CFG_TX_ITFSP_MODE_MASK\t\tBIT(14)\n+#define RTL8365MB_PORT_MISC_CFG_FLOWCTRL_INDEP_MASK\t\tBIT(13)\n+#define RTL8365MB_PORT_MISC_CFG_DOT1Q_REMARK_ENABLE_MASK\tBIT(12)\n+#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_FLOWCTRL_MASK\tBIT(11)\n+#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_IFG_MASK\t\tBIT(10)\n+#define RTL8365MB_PORT_MISC_CFG_RX_SPC_MASK\t\t\tBIT(9)\n+#define RTL8365MB_PORT_MISC_CFG_CRC_SKIP_MASK\t\t\tBIT(8)\n+#define RTL8365MB_PORT_MISC_CFG_PKTGEN_TX_FIRST_MASK\t\tBIT(7)\n+#define RTL8365MB_PORT_MISC_CFG_MAC_LOOPBACK_MASK\t\tBIT(6)\n /* See \u0026rtl8365mb_vlan_egress_mode */\n-#define RTL8365MB_PORT_MISC_CFG_VLAN_EGRESS_MODE_MASK\t\t0x0030\n-#define RTL8365MB_PORT_MISC_CFG_CONGESTION_SUSTAIN_TIME_MASK\t0x000F\n+#define RTL8365MB_PORT_MISC_CFG_VLAN_EGRESS_MODE_MASK\t\tGENMASK(5, 4)\n+#define RTL8365MB_PORT_MISC_CFG_CONGESTION_SUSTAIN_TIME_MASK\tGENMASK(3, 0)\n \n /**\n * enum rtl8365mb_vlan_egress_mode - port VLAN egress mode\n@@ -459,7 +461,7 @@ enum rtl8365mb_vlan_egress_mode {\n \n /* VLAN control register */\n #define RTL8365MB_VLAN_CTRL_REG\t\t\t0x07A8\n-#define RTL8365MB_VLAN_CTRL_EN_MASK\t\t0x0001\n+#define RTL8365MB_VLAN_CTRL_EN_MASK\t\tBIT(0)\n \n /* VLAN ingress filter register */\n #define RTL8365MB_VLAN_INGRESS_REG\t\t\t\t0x07A9\n@@ -483,8 +485,8 @@ enum rtl8365mb_vlan_egress_mode {\n \t\t(((RTL8365MB_MIB_ADDRESS_PORT_OFFSET) * (_p) + (_x)) \u003e\u003e 2)\n \n #define RTL8365MB_MIB_CTRL0_REG\t\t\t0x1005\n-#define RTL8365MB_MIB_CTRL0_RESET_MASK\t0x0002\n-#define RTL8365MB_MIB_CTRL0_BUSY_MASK\t\t0x0001\n+#define RTL8365MB_MIB_CTRL0_RESET_MASK\tBIT(1)\n+#define RTL8365MB_MIB_CTRL0_BUSY_MASK\t\tBIT(0)\n \n /* The DSA callback .get_stats64 runs in atomic context, so we are not allowed\n * to block. On the other hand, accessing MIB counters absolutely requires us to\ndiff --git a/drivers/net/dsa/realtek/rtl8365mb_vlan.c b/drivers/net/dsa/realtek/rtl8365mb_vlan.c\nindex 64dd8d90a5ee6..8d49ffadce926 100644\n--- a/drivers/net/dsa/realtek/rtl8365mb_vlan.c\n+++ b/drivers/net/dsa/realtek/rtl8365mb_vlan.c\n@@ -106,8 +106,8 @@\n #define RTL8365MB_VLAN_PVID_CTRL_BASE\t\t\t0x0700\n #define RTL8365MB_VLAN_PVID_CTRL_REG(_p) \\\n \t\t(RTL8365MB_VLAN_PVID_CTRL_BASE + ((_p) \u003e\u003e 1))\n-#define RTL8365MB_VLAN_PVID_CTRL_PORT0_MCIDX_MASK\t0x001F\n-#define RTL8365MB_VLAN_PVID_CTRL_PORT1_MCIDX_MASK\t0x1F00\n+#define RTL8365MB_VLAN_PVID_CTRL_PORT0_MCIDX_MASK\tGENMASK(4, 0)\n+#define RTL8365MB_VLAN_PVID_CTRL_PORT1_MCIDX_MASK\tGENMASK(12, 8)\n #define RTL8365MB_VLAN_PVID_CTRL_PORT_MCIDX_OFFSET(_p) \\\n \t\t(((_p) \u0026 1) \u003c\u003c 3)\n #define RTL8365MB_VLAN_PVID_CTRL_PORT_MCIDX_MASK(_p) \\\n"
} |
| 2/1 | 2026/10/03 03:59 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only performs cosmetic refactoring of register bitmask macros in the Realtek RTL8365MB switch driver, converting raw hex constants to BIT() and GENMASK() without modifying any executable C logic or runtime behavior. Furthermore, the driver targets physical Realtek switch ASICs (connected via SMI/MDIO) that are structurally unreachable in standard virtualized fuzzing environments.",
"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 8aab3b48e9cd0a206d3387b15d7141f83c7e0f98
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Oct 3 03:59:05 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
index 87ec924a06118..da06f952a053d 100644
--- a/drivers/net/dsa/realtek/rtl8365mb_main.c
+++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
@@ -132,32 +132,32 @@
#define RTL8365MB_MAGIC_VALUE 0x0249
/* Chip reset register */
-#define RTL8365MB_CHIP_RESET_REG 0x1322
-#define RTL8365MB_CHIP_RESET_DW8051_MASK 0x0010
-#define RTL8365MB_CHIP_RESET_SW_MASK 0x0002
-#define RTL8365MB_CHIP_RESET_HW_MASK 0x0001
+#define RTL8365MB_CHIP_RESET_REG 0x1322
+#define RTL8365MB_CHIP_RESET_DW8051_MASK BIT(4)
+#define RTL8365MB_CHIP_RESET_SW_MASK BIT(1)
+#define RTL8365MB_CHIP_RESET_HW_MASK BIT(0)
/* Interrupt polarity register */
#define RTL8365MB_INTR_POLARITY_REG 0x1100
-#define RTL8365MB_INTR_POLARITY_MASK 0x0001
+#define RTL8365MB_INTR_POLARITY_MASK BIT(0)
#define RTL8365MB_INTR_POLARITY_HIGH 0
#define RTL8365MB_INTR_POLARITY_LOW 1
/* Interrupt control/status register - enable/check specific interrupt types */
#define RTL8365MB_INTR_CTRL_REG 0x1101
-#define RTL8365MB_INTR_STATUS_REG 0x1102
-#define RTL8365MB_INTR_SLIENT_START_2_MASK 0x1000
-#define RTL8365MB_INTR_SLIENT_START_MASK 0x0800
-#define RTL8365MB_INTR_ACL_ACTION_MASK 0x0200
-#define RTL8365MB_INTR_CABLE_DIAG_FIN_MASK 0x0100
-#define RTL8365MB_INTR_INTERRUPT_8051_MASK 0x0080
-#define RTL8365MB_INTR_LOOP_DETECTION_MASK 0x0040
-#define RTL8365MB_INTR_GREEN_TIMER_MASK 0x0020
-#define RTL8365MB_INTR_SPECIAL_CONGEST_MASK 0x0010
-#define RTL8365MB_INTR_SPEED_CHANGE_MASK 0x0008
-#define RTL8365MB_INTR_LEARN_OVER_MASK 0x0004
-#define RTL8365MB_INTR_METER_EXCEEDED_MASK 0x0002
-#define RTL8365MB_INTR_LINK_CHANGE_MASK 0x0001
+#define RTL8365MB_INTR_STATUS_REG 0x1102
+#define RTL8365MB_INTR_SLIENT_START_2_MASK BIT(12)
+#define RTL8365MB_INTR_SLIENT_START_MASK BIT(11)
+#define RTL8365MB_INTR_ACL_ACTION_MASK BIT(9)
+#define RTL8365MB_INTR_CABLE_DIAG_FIN_MASK BIT(8)
+#define RTL8365MB_INTR_INTERRUPT_8051_MASK BIT(7)
+#define RTL8365MB_INTR_LOOP_DETECTION_MASK BIT(6)
+#define RTL8365MB_INTR_GREEN_TIMER_MASK BIT(5)
+#define RTL8365MB_INTR_SPECIAL_CONGEST_MASK BIT(4)
+#define RTL8365MB_INTR_SPEED_CHANGE_MASK BIT(3)
+#define RTL8365MB_INTR_LEARN_OVER_MASK BIT(2)
+#define RTL8365MB_INTR_METER_EXCEEDED_MASK BIT(1)
+#define RTL8365MB_INTR_LINK_CHANGE_MASK BIT(0)
#define RTL8365MB_INTR_ALL_MASK \
(RTL8365MB_INTR_SLIENT_START_2_MASK | \
RTL8365MB_INTR_SLIENT_START_MASK | \
@@ -172,20 +172,22 @@
RTL8365MB_INTR_METER_EXCEEDED_MASK | \
RTL8365MB_INTR_LINK_CHANGE_MASK)
+#define RTL8365MB_PORT_MASK GENMASK(10, 0)
+
/* Per-port interrupt type status registers */
#define RTL8365MB_PORT_LINKDOWN_IND_REG 0x1106
-#define RTL8365MB_PORT_LINKDOWN_IND_MASK 0x07FF
+#define RTL8365MB_PORT_LINKDOWN_IND_MASK RTL8365MB_PORT_MASK
#define RTL8365MB_PORT_LINKUP_IND_REG 0x1107
-#define RTL8365MB_PORT_LINKUP_IND_MASK 0x07FF
+#define RTL8365MB_PORT_LINKUP_IND_MASK RTL8365MB_PORT_MASK
/* PHY indirect access registers */
#define RTL8365MB_INDIRECT_ACCESS_CTRL_REG 0x1F00
-#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_MASK 0x0002
-#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_READ 0
-#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_WRITE 1
-#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_MASK 0x0001
-#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_VALUE 1
+#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_MASK BIT(1)
+#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_READ 0
+#define RTL8365MB_INDIRECT_ACCESS_CTRL_RW_WRITE 1
+#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_MASK BIT(0)
+#define RTL8365MB_INDIRECT_ACCESS_CTRL_CMD_VALUE 1
#define RTL8365MB_INDIRECT_ACCESS_STATUS_REG 0x1F01
#define RTL8365MB_INDIRECT_ACCESS_ADDRESS_REG 0x1F02
#define RTL8365MB_INDIRECT_ACCESS_ADDRESS_OCPADR_5_1_MASK GENMASK(4, 0)
@@ -197,8 +199,8 @@
/* PHY OCP address prefix register */
#define RTL8365MB_GPHY_OCP_MSB_0_REG 0x1D15
-#define RTL8365MB_GPHY_OCP_MSB_0_CFG_CPU_OCPADR_MASK 0x0FC0
-#define RTL8365MB_PHY_OCP_ADDR_PREFIX_MASK 0xFC00
+#define RTL8365MB_GPHY_OCP_MSB_0_CFG_CPU_OCPADR_MASK GENMASK(11, 6)
+#define RTL8365MB_PHY_OCP_ADDR_PREFIX_MASK GENMASK(15, 10)
/* The full 16-bit OCP address is split across two registers: bits [15:10] are
* the prefix (RTL8365MB_PHY_OCP_ADDR_PREFIX_MASK above), and bits [9:1] go into
@@ -252,8 +254,8 @@
(_extint) == 1 ? RTL8365MB_EXT_RGMXF_REG1 : \
(_extint) == 2 ? RTL8365MB_EXT_RGMXF_REG2 : \
0x0)
-#define RTL8365MB_EXT_RGMXF_RXDELAY_MASK 0x0007
-#define RTL8365MB_EXT_RGMXF_TXDELAY_MASK 0x0008
+#define RTL8365MB_EXT_RGMXF_RXDELAY_MASK GENMASK(2, 0)
+#define RTL8365MB_EXT_RGMXF_TXDELAY_MASK BIT(3)
/* External interface line rate bypass register - one bit per external
* interface, indexed by the external port number with port 5 (the first
@@ -271,28 +273,28 @@
*/
#define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL0_REG 0x00CF
#define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL1_REG 0x00D0
-#define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL1_MASK 0x0007
+#define RTL8365MB_INGRESSBW_PORT6_RATE_CTRL1_MASK GENMASK(2, 0)
#define RTL8365MB_PORT6_EGRESSBW_CTRL0_REG 0x0398
#define RTL8365MB_PORT6_EGRESSBW_CTRL1_REG 0x0399
-#define RTL8365MB_PORT6_EGRESSBW_CTRL1_MASK 0x0007
+#define RTL8365MB_PORT6_EGRESSBW_CTRL1_MASK GENMASK(2, 0)
/* SerDes indirect access registers */
#define RTL8365MB_SDS_INDACS_CMD_REG 0x6600
-#define RTL8365MB_SDS_INDACS_CMD_BUSY_MASK 0x0100
-#define RTL8365MB_SDS_INDACS_CMD_RUN_MASK 0x0080
-#define RTL8365MB_SDS_INDACS_CMD_WR_MASK 0x0040
+#define RTL8365MB_SDS_INDACS_CMD_BUSY_MASK BIT(8)
+#define RTL8365MB_SDS_INDACS_CMD_RUN_MASK BIT(7)
+#define RTL8365MB_SDS_INDACS_CMD_WR_MASK BIT(6)
#define RTL8365MB_SDS_INDACS_ADR_REG 0x6601
#define RTL8365MB_SDS_INDACS_DATA_REG 0x6602
/* SerDes miscellaneous configuration register */
#define RTL8365MB_SDS_MISC_REG 0x1D11
-#define RTL8365MB_SDS_MISC_SGMII_RXFC_MASK 0x4000
-#define RTL8365MB_SDS_MISC_SGMII_TXFC_MASK 0x2000
-#define RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK 0x0800
-#define RTL8365MB_SDS_MISC_SGMII_FDUP_MASK 0x0400
-#define RTL8365MB_SDS_MISC_SGMII_LINK_MASK 0x0200
-#define RTL8365MB_SDS_MISC_SGMII_SPD_MASK 0x0180
-#define RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK 0x0040
+#define RTL8365MB_SDS_MISC_SGMII_RXFC_MASK BIT(14)
+#define RTL8365MB_SDS_MISC_SGMII_TXFC_MASK BIT(13)
+#define RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK BIT(11)
+#define RTL8365MB_SDS_MISC_SGMII_FDUP_MASK BIT(10)
+#define RTL8365MB_SDS_MISC_SGMII_LINK_MASK BIT(9)
+#define RTL8365MB_SDS_MISC_SGMII_SPD_MASK GENMASK(8, 7)
+#define RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK BIT(6)
/* SerDes internal registers, accessed via the SDS_INDACS registers. The BMCR
* data path reset holds BMCR_ANENABLE | BMCR_ISOLATE while toggling the
@@ -303,12 +305,12 @@
#define RTL8365MB_SDS_BMCR_DPRST_PHASE1 (BMCR_ANENABLE | BMCR_ISOLATE | 0x1)
#define RTL8365MB_SDS_BMCR_DPRST_PHASE2 (BMCR_ANENABLE | BMCR_ISOLATE | 0x3)
#define RTL8365MB_SDS_REG_NWAY 0x0002
-#define RTL8365MB_SDS_NWAY_EN_MASK 0x0200
-#define RTL8365MB_SDS_NWAY_RESTART_MASK 0x0100
+#define RTL8365MB_SDS_NWAY_EN_MASK BIT(9)
+#define RTL8365MB_SDS_NWAY_RESTART_MASK BIT(8)
#define RTL8365MB_SDS_REG_RESET 0x0003
#define RTL8365MB_SDS_RESET_DEASSERT 0x7106
#define RTL8365MB_SDS_REG_LINK_STATUS 0x003d
-#define RTL8365MB_SDS_LINK_STATUS_LINK_MASK 0x0010
+#define RTL8365MB_SDS_LINK_STATUS_LINK_MASK BIT(4)
/* The embedded SerDes can only be muxed to external interface 1 (MAC8),
* which is port 6.
@@ -335,7 +337,7 @@
* the firmware would otherwise do.
*/
#define RTL8365MB_MISC_CFG0_REG 0x130C
-#define RTL8365MB_MISC_CFG0_DW8051_EN_MASK 0x0020
+#define RTL8365MB_MISC_CFG0_DW8051_EN_MASK BIT(5)
/* External interface port speed values - used in DIGITAL_INTERFACE_FORCE */
#define RTL8365MB_PORT_SPEED_10M 0
@@ -351,31 +353,31 @@
(_extint) == 1 ? RTL8365MB_DIGITAL_INTERFACE_FORCE_REG1 : \
(_extint) == 2 ? RTL8365MB_DIGITAL_INTERFACE_FORCE_REG2 : \
0x0)
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_EN_MASK 0x1000
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_NWAY_MASK 0x0080
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_TXPAUSE_MASK 0x0040
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_RXPAUSE_MASK 0x0020
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_LINK_MASK 0x0010
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_DUPLEX_MASK 0x0004
-#define RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK 0x0003
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_EN_MASK BIT(12)
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_NWAY_MASK BIT(7)
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_TXPAUSE_MASK BIT(6)
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_RXPAUSE_MASK BIT(5)
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_LINK_MASK BIT(4)
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_DUPLEX_MASK BIT(2)
+#define RTL8365MB_DIGITAL_INTERFACE_FORCE_SPEED_MASK GENMASK(1, 0)
/* CPU port mask register - controls which ports are treated as CPU ports */
#define RTL8365MB_CPU_PORT_MASK_REG 0x1219
-#define RTL8365MB_CPU_PORT_MASK_MASK 0x07FF
+#define RTL8365MB_CPU_PORT_MASK_MASK RTL8365MB_PORT_MASK
/* CPU control register */
#define RTL8365MB_CPU_CTRL_REG 0x121A
-#define RTL8365MB_CPU_CTRL_TRAP_PORT_EXT_MASK 0x0400
-#define RTL8365MB_CPU_CTRL_TAG_FORMAT_MASK 0x0200
-#define RTL8365MB_CPU_CTRL_RXBYTECOUNT_MASK 0x0080
-#define RTL8365MB_CPU_CTRL_TAG_POSITION_MASK 0x0040
-#define RTL8365MB_CPU_CTRL_TRAP_PORT_MASK 0x0038
-#define RTL8365MB_CPU_CTRL_INSERTMODE_MASK 0x0006
-#define RTL8365MB_CPU_CTRL_EN_MASK 0x0001
+#define RTL8365MB_CPU_CTRL_TRAP_PORT_EXT_MASK BIT(10)
+#define RTL8365MB_CPU_CTRL_TAG_FORMAT_MASK BIT(9)
+#define RTL8365MB_CPU_CTRL_RXBYTECOUNT_MASK BIT(7)
+#define RTL8365MB_CPU_CTRL_TAG_POSITION_MASK BIT(6)
+#define RTL8365MB_CPU_CTRL_TRAP_PORT_MASK GENMASK(5, 3)
+#define RTL8365MB_CPU_CTRL_INSERTMODE_MASK GENMASK(2, 1)
+#define RTL8365MB_CPU_CTRL_EN_MASK BIT(0)
/* Maximum packet length register */
#define RTL8365MB_CFG0_MAX_LEN_REG 0x088C
-#define RTL8365MB_CFG0_MAX_LEN_MASK 0x3FFF
+#define RTL8365MB_CFG0_MAX_LEN_MASK GENMASK(13, 0)
#define RTL8365MB_CFG0_MAX_LEN_MAX 0x3FFF
/* Port learning limit registers */
@@ -387,7 +389,7 @@
#define RTL8365MB_PORT_ISOLATION_REG_BASE 0x08A2
#define RTL8365MB_PORT_ISOLATION_REG(_physport) \
(RTL8365MB_PORT_ISOLATION_REG_BASE + (_physport))
-#define RTL8365MB_PORT_ISOLATION_MASK 0x07FF
+#define RTL8365MB_PORT_ISOLATION_MASK RTL8365MB_PORT_MASK
/* Extended filter ID registers - used to key forwarding database with IVL */
#define RTL8365MB_EFID_MASK GENMASK(2, 0)
@@ -407,16 +409,16 @@
(0x3 << RTL8365MB_MSTI_CTRL_PORT_STATE_OFFSET((_physport)))
/* Unknown unicast DA flooding port mask */
-#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_REG 0x0890
-#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_MASK 0x07FF
+#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_REG 0x0890
+#define RTL8365MB_UNKNOWN_UNICAST_FLOODING_PMASK_MASK RTL8365MB_PORT_MASK
/* Unknown multicast DA flooding port mask */
-#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_REG 0x0891
-#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_MASK 0x07FF
+#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_REG 0x0891
+#define RTL8365MB_UNKNOWN_MULTICAST_FLOODING_PMASK_MASK RTL8365MB_PORT_MASK
/* Broadcast flooding port mask */
-#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_REG 0x0892
-#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_MASK 0x07FF
+#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_REG 0x0892
+#define RTL8365MB_UNKNOWN_BROADCAST_FLOODING_PMASK_MASK RTL8365MB_PORT_MASK
#define RTL8365MB_SUPPORTED_BRIDGE_FLAGS \
(BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD | BR_BCAST_FLOOD)
@@ -425,19 +427,19 @@
#define RTL8365MB_PORT_MISC_CFG_REG_BASE 0x000E
#define RTL8365MB_PORT_MISC_CFG_REG(_p) \
(RTL8365MB_PORT_MISC_CFG_REG_BASE + ((_p) << 5))
-#define RTL8365MB_PORT_MISC_CFG_SMALL_TAG_IPG_MASK 0x8000
-#define RTL8365MB_PORT_MISC_CFG_TX_ITFSP_MODE_MASK 0x4000
-#define RTL8365MB_PORT_MISC_CFG_FLOWCTRL_INDEP_MASK 0x2000
-#define RTL8365MB_PORT_MISC_CFG_DOT1Q_REMARK_ENABLE_MASK 0x1000
-#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_FLOWCTRL_MASK 0x0800
-#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_IFG_MASK 0x0400
-#define RTL8365MB_PORT_MISC_CFG_RX_SPC_MASK 0x0200
-#define RTL8365MB_PORT_MISC_CFG_CRC_SKIP_MASK 0x0100
-#define RTL8365MB_PORT_MISC_CFG_PKTGEN_TX_FIRST_MASK 0x0080
-#define RTL8365MB_PORT_MISC_CFG_MAC_LOOPBACK_MASK 0x0040
+#define RTL8365MB_PORT_MISC_CFG_SMALL_TAG_IPG_MASK BIT(15)
+#define RTL8365MB_PORT_MISC_CFG_TX_ITFSP_MODE_MASK BIT(14)
+#define RTL8365MB_PORT_MISC_CFG_FLOWCTRL_INDEP_MASK BIT(13)
+#define RTL8365MB_PORT_MISC_CFG_DOT1Q_REMARK_ENABLE_MASK BIT(12)
+#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_FLOWCTRL_MASK BIT(11)
+#define RTL8365MB_PORT_MISC_CFG_INGRESSBW_IFG_MASK BIT(10)
+#define RTL8365MB_PORT_MISC_CFG_RX_SPC_MASK BIT(9)
+#define RTL8365MB_PORT_MISC_CFG_CRC_SKIP_MASK BIT(8)
+#define RTL8365MB_PORT_MISC_CFG_PKTGEN_TX_FIRST_MASK BIT(7)
+#define RTL8365MB_PORT_MISC_CFG_MAC_LOOPBACK_MASK BIT(6)
/* See &rtl8365mb_vlan_egress_mode */
-#define RTL8365MB_PORT_MISC_CFG_VLAN_EGRESS_MODE_MASK 0x0030
-#define RTL8365MB_PORT_MISC_CFG_CONGESTION_SUSTAIN_TIME_MASK 0x000F
+#define RTL8365MB_PORT_MISC_CFG_VLAN_EGRESS_MODE_MASK GENMASK(5, 4)
+#define RTL8365MB_PORT_MISC_CFG_CONGESTION_SUSTAIN_TIME_MASK GENMASK(3, 0)
/**
* enum rtl8365mb_vlan_egress_mode - port VLAN egress mode
@@ -459,7 +461,7 @@ enum rtl8365mb_vlan_egress_mode {
/* VLAN control register */
#define RTL8365MB_VLAN_CTRL_REG 0x07A8
-#define RTL8365MB_VLAN_CTRL_EN_MASK 0x0001
+#define RTL8365MB_VLAN_CTRL_EN_MASK BIT(0)
/* VLAN ingress filter register */
#define RTL8365MB_VLAN_INGRESS_REG 0x07A9
@@ -483,8 +485,8 @@ enum rtl8365mb_vlan_egress_mode {
(((RTL8365MB_MIB_ADDRESS_PORT_OFFSET) * (_p) + (_x)) >> 2)
#define RTL8365MB_MIB_CTRL0_REG 0x1005
-#define RTL8365MB_MIB_CTRL0_RESET_MASK 0x0002
-#define RTL8365MB_MIB_CTRL0_BUSY_MASK 0x0001
+#define RTL8365MB_MIB_CTRL0_RESET_MASK BIT(1)
+#define RTL8365MB_MIB_CTRL0_BUSY_MASK BIT(0)
/* The DSA callback .get_stats64 runs in atomic context, so we are not allowed
* to block. On the other hand, accessing MIB counters absolutely requires us to
diff --git a/drivers/net/dsa/realtek/rtl8365mb_vlan.c b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
index 64dd8d90a5ee6..8d49ffadce926 100644
--- a/drivers/net/dsa/realtek/rtl8365mb_vlan.c
+++ b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
@@ -106,8 +106,8 @@
#define RTL8365MB_VLAN_PVID_CTRL_BASE 0x0700
#define RTL8365MB_VLAN_PVID_CTRL_REG(_p) \
(RTL8365MB_VLAN_PVID_CTRL_BASE + ((_p) >> 1))
-#define RTL8365MB_VLAN_PVID_CTRL_PORT0_MCIDX_MASK 0x001F
-#define RTL8365MB_VLAN_PVID_CTRL_PORT1_MCIDX_MASK 0x1F00
+#define RTL8365MB_VLAN_PVID_CTRL_PORT0_MCIDX_MASK GENMASK(4, 0)
+#define RTL8365MB_VLAN_PVID_CTRL_PORT1_MCIDX_MASK GENMASK(12, 8)
#define RTL8365MB_VLAN_PVID_CTRL_PORT_MCIDX_OFFSET(_p) \
(((_p) & 1) << 3)
#define RTL8365MB_VLAN_PVID_CTRL_PORT_MCIDX_MASK(_p) \
|
| 3/2 | 2026/10/03 03:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10343 output: 36 thoughts: 3146 Thoughts: **Patch Analysis: Macro Replacement - Fuzzing Potential Assessment** Alright, let's break this down. My initial thought was to determine if this patch merits syzkaller fuzzing. The patch is touching `rtl8365mb_main.c` and `rtl8365mb_vlan.c`, both within the Realtek DSA (Distributed Switch Architecture) driver directory. The key change seems to be the replacement of raw hex masks (e.g., `0x0010`) with `BIT()`, `GENMASK()` macros, and potentially a `define` statement. My first impression is that this *appears* to be purely a code style refactoring, converting to bitfield manipulation macros which are safer than raw numbers. I've double-checked the diff carefully and it's solely about these macro substitutions. Line numbers and constant values match the existing definitions. Each `BIT()` expands to the same bitmask, and `GENMASK()` is accurately reconstructing the same bitmasks as the original hex literals. Given this, I'm leaning heavily towards "no" for syzkaller fuzzing. Section 2 of the instructions, covering "non-kernel and non-executable changes," explicitly states that pure macro substitutions or cosmetic changes don't warrant fuzzing. This looks like a *textual* change that won't modify the compiled kernel's logic. Furthermore, I need to know if it's hardware-dependent, but based on my expertise in this area, Realtek DSA chips are likely hardware-dependent, which rules out QEMU use. Just to be absolutely sure, I'll use a tool to check, but this looks like a straightforward case of code cleanup that won't introduce new vulnerabilities or execution paths and therefore isn't likely worth the effort of fuzzing. |
| 4/2 | 2026/10/03 03:59 | tool | grepper |
0mArgs:{
"Expression": "rtl8365mb",
"PathPrefix": "drivers/net/dsa/realtek/"
}Results: {
"Output": "\nFull output is too long, showing 200 out of 1723 lines.\nUse more precise expression if possible.\n\ndrivers/net/dsa/realtek/Makefile=17=endif\ndrivers/net/dsa/realtek/Makefile:18:obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o\ndrivers/net/dsa/realtek/Makefile:19:rtl8365mb-objs := rtl8365mb_main.o \\\ndrivers/net/dsa/realtek/Makefile:20:\t\t rtl8365mb_table.o \\\ndrivers/net/dsa/realtek/Makefile:21:\t\t rtl8365mb_vlan.o \\\ndrivers/net/dsa/realtek/Makefile:22:\t\t rtl8365mb_l2.o \\\ndrivers/net/dsa/realtek/Makefile:23:# end of rtl8365mb-objs\n--\ndrivers/net/dsa/realtek/realtek.h=197=extern const struct realtek_variant rtl8366rb_variant;\ndrivers/net/dsa/realtek/realtek.h:198:extern const struct realtek_variant rtl8365mb_variant;\ndrivers/net/dsa/realtek/realtek.h-199-\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-1-// SPDX-License-Identifier: GPL-2.0\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:2:/* Forwarding and multicast database interface for the rtl8365mb switch family\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-3- *\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-8-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:9:#include \"rtl8365mb_l2.h\"\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:10:#include \"rtl8365mb_table.h\"\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-11-#include \u003clinux/regmap.h\u003e\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-91-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:92:struct rtl8365mb_l2_uc_key {\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-93-\tu8 mac_addr[ETH_ALEN];\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-99-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:100:struct rtl8365mb_l2_uc {\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:101:\tstruct rtl8365mb_l2_uc_key key;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-102-\tu8 port;\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-113-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:114:struct rtl8365mb_l2_mc_key {\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-115-\tu8 mac_addr[ETH_ALEN];\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-122-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:123:struct rtl8365mb_l2_mc {\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:124:\tstruct rtl8365mb_l2_mc_key key;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-125-\tu16 member;\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-133-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:134:static void rtl8365mb_l2_data_to_uc(const u16 *data, struct rtl8365mb_l2_uc *uc)\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-135-{\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-163-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:164:static void rtl8365mb_l2_uc_to_data(const struct rtl8365mb_l2_uc *uc, u16 *data)\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-165-{\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-202-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:203:static void rtl8365mb_l2_data_to_mc(const u16 *data, struct rtl8365mb_l2_mc *mc)\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-204-{\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-230-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:231:static void rtl8365mb_l2_mc_to_data(const struct rtl8365mb_l2_mc *mc, u16 *data)\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-232-{\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-261-/*\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:262: * rtl8365mb_l2_get_next_uc() - get the next Unicast L2 entry\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-263- * @priv: realtek_priv pointer\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-281- **/\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:282:int rtl8365mb_l2_get_next_uc(struct realtek_priv *priv, u16 *addr, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-283-\t\t\t struct realtek_fdb_entry *entry)\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-285-\tu16 data[RTL8365MB_L2_ENTRY_SIZE] = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:286:\tstruct rtl8365mb_l2_uc uc;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-287-\tint ret;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-288-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:289:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-290-\t\t\t\t RTL8365MB_TABLE_OP_READ, addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-295-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:296:\trtl8365mb_l2_data_to_uc(data, \u0026uc);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-297-\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-304-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:305:int rtl8365mb_l2_add_uc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-306-\t\t\tconst unsigned char mac_addr[static ETH_ALEN],\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-309-\tu16 data[RTL8365MB_L2_ENTRY_SIZE] = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:310:\tstruct rtl8365mb_l2_uc uc = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-311-\tu16 addr;\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-328-\tuc.age = 1;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:329:\trtl8365mb_l2_uc_to_data(\u0026uc, data);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-330-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-331-\t/* add the new entry or update an existing one */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:332:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-333-\t\t\t\t RTL8365MB_TABLE_OP_WRITE, \u0026addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-344-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:345:int rtl8365mb_l2_del_uc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-346-\t\t\tconst unsigned char mac_addr[static ETH_ALEN],\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-349-\tu16 data[RTL8365MB_L2_ENTRY_SIZE] = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:350:\tstruct rtl8365mb_l2_uc uc = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-351-\tu16 addr;\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-360-\tuc.age = 0;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:361:\trtl8365mb_l2_uc_to_data(\u0026uc, data);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-362-\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-367-\t */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:368:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-369-\t\t\t\t RTL8365MB_TABLE_OP_WRITE, \u0026addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-383-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:384:int rtl8365mb_l2_flush(struct realtek_priv *priv, int port, u16 vid)\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-385-{\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-448-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:449:int rtl8365mb_l2_add_mc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-450-\t\t\tconst unsigned char mac_addr[static ETH_ALEN],\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-453-\tu16 data[RTL8365MB_L2_ENTRY_SIZE] = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:454:\tstruct rtl8365mb_l2_mc mc = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-455-\tu16 addr;\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-465-\tmc.is_static = 1;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:466:\trtl8365mb_l2_mc_to_data(\u0026mc, data);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-467-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-468-\t/* First look for an existing entry (to get existing port members) */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:469:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-470-\t\t\t\t RTL8365MB_TABLE_OP_READ, \u0026addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-474-\t\t/* There is already an entry... */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:475:\t\trtl8365mb_l2_data_to_mc(data, \u0026mc);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-476-\t\tdev_dbg(priv-\u003edev,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-489-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:490:\t\trtl8365mb_l2_mc_to_data(\u0026mc, data);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-491-\t} else if (ret == -ENOENT) {\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-507-\t/* add the new entry or update an existing one */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:508:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-509-\t\t\t\t RTL8365MB_TABLE_OP_WRITE, \u0026addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-519-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:520:int rtl8365mb_l2_del_mc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-521-\t\t\tconst unsigned char mac_addr[static ETH_ALEN],\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-524-\tu16 data[RTL8365MB_L2_ENTRY_SIZE] = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:525:\tstruct rtl8365mb_l2_mc mc = { 0 };\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-526-\tu16 addr;\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-531-\tmc.key.ivl = true;\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:532:\trtl8365mb_l2_mc_to_data(\u0026mc, data);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-533-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-534-\t/* First look for an existing entry (to get existing port members) */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:535:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-536-\t\t\t\t RTL8365MB_TABLE_OP_READ, \u0026addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-549-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:550:\trtl8365mb_l2_data_to_mc(data, \u0026mc);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-551-\tdev_dbg(priv-\u003edev,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-567-\t}\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:568:\trtl8365mb_l2_mc_to_data(\u0026mc, data);\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-569-\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-570-\t/* update the existing entry. */\ndrivers/net/dsa/realtek/rtl8365mb_l2.c:571:\tret = rtl8365mb_table_query(priv, RTL8365MB_TABLE_L2,\ndrivers/net/dsa/realtek/rtl8365mb_l2.c-572-\t\t\t\t RTL8365MB_TABLE_OP_WRITE, \u0026addr,\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-1-/* SPDX-License-Identifier: GPL-2.0 */\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:2:/* Forwarding and multicast database interface for the rtl8365mb switch family\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-3- *\n--\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-14-\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:15:int rtl8365mb_l2_get_next_uc(struct realtek_priv *priv, u16 *addr, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-16-\t\t\t struct realtek_fdb_entry *entry);\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:17:int rtl8365mb_l2_add_uc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-18-\t\t\tconst unsigned char addr[static ETH_ALEN],\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-19-\t\t\tu16 efid, u16 vid);\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:20:int rtl8365mb_l2_del_uc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-21-\t\t\tconst unsigned char addr[static ETH_ALEN],\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-22-\t\t\tu16 efid, u16 vid);\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:23:int rtl8365mb_l2_flush(struct realtek_priv *priv, int port, u16 vid);\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-24-\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:25:int rtl8365mb_l2_add_mc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-26-\t\t\tconst unsigned char mac_addr[static ETH_ALEN],\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-27-\t\t\tu16 vid);\ndrivers/net/dsa/realtek/rtl8365mb_l2.h:28:int rtl8365mb_l2_del_mc(struct realtek_priv *priv, int port,\ndrivers/net/dsa/realtek/rtl8365mb_l2.h-29-\t\t\tconst unsigned char mac_addr[static ETH_ALEN],\n--\ndrivers/net/dsa/realtek/rtl8365mb_main.c-64- * require the rtl8367d vendor driver. With all this uncertainty, the driver has\ndrivers/net/dsa/realtek/rtl8365mb_main.c:65: * been modestly named rtl8365mb. Future implementors may wish to rename things\ndrivers/net/dsa/realtek/rtl8365mb_main.c-66- * accordingly.\n--\ndrivers/net/dsa/realtek/rtl8365mb_main.c-110-#include \"rtl83xx.h\"\ndrivers/net/dsa/realtek/rtl8365mb_main.c:111:#include \"rtl8365mb_l2.h\"\ndrivers/net/dsa/realtek/rtl8365mb_main.c:112:#include \"rtl8365mb_vlan.h\"\ndrivers/net/dsa/realtek/rtl8365mb_main.c-113-\n--\ndrivers/net/dsa/realtek/rtl8365mb_main.c-271- * 3-bit MSB field (CTRL1). The chip resets them to 0x1FFFF; see\ndrivers/net/dsa/realtek/rtl8365mb_main.c:272: * rtl8365mb_sds_raise_rate_limits().\ndrivers/net/dsa/realtek/rtl8365mb_main.c-273- */\n--\ndrivers/net/dsa/realtek/rtl8365mb_main.c-439-#define RTL8365MB_PORT_MISC_CFG_MAC_LOOPBACK_MASK\t\tBIT(6)\ndrivers/net/dsa/realtek/rtl8365mb_main.c:440:/* See \u0026rtl8365mb_vlan_egress_mode */\ndrivers/net/dsa/realtek/rtl8365mb_main.c-441-#define RTL8365MB_PORT_MISC_CFG_VLAN_EGRESS_MODE_MASK\t\tGENMASK(5, 4)\n--\n\n"
} |
| 5/2 | 2026/10/03 03:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20345 output: 38 thoughts: 18 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Navigating the Realtek DSA Landscape** Alright, time to get to the heart of the matter. My mental map immediately jumps to the Realtek DSA driver configuration. Specifically, I need to take a look at `drivers/net/dsa/realtek/Kconfig`. This tells me we're dealing with the Realtek-specific configuration options within the Distributed Switch Architecture (DSA) framework. I expect to find the usual suspects: feature enablement, hardware variants, maybe some debugging options. What I *really* want to see is how the vendor-specific features are exposed and configured within the broader DSA structure. Are they neatly integrated, or is it a bit of a messy overlay? Knowing the build configuration is key to understanding the possibilities. Knowing what configuration options are available will help us to navigate this code. We should find out what configuration options there are, so we can consider whether they are a good fit for us. |
| 6/2 | 2026/10/03 03:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/dsa/realtek/Kconfig",
"FirstLine": 1,
"LineCount": 80
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\tmenuconfig NET_DSA_REALTEK\n 3:\t\ttristate \"Realtek Ethernet switch family support\"\n 4:\t\tdepends on NET_DSA\n 5:\t\tselect FIXED_PHY\n 6:\t\tselect IRQ_DOMAIN\n 7:\t\tselect REALTEK_PHY\n 8:\t\tselect REGMAP\n 9:\t\thelp\n 10:\t\t Select to enable support for Realtek Ethernet switch chips.\n 11:\t\n 12:\t\t Note that at least one interface driver must be enabled for the\n 13:\t\t subdrivers to be loaded. Moreover, an interface driver cannot achieve\n 14:\t\t anything without at least one subdriver enabled.\n 15:\t\n 16:\tif NET_DSA_REALTEK\n 17:\t\n 18:\tconfig NET_DSA_REALTEK_MDIO\n 19:\t\tbool \"Realtek MDIO interface support\"\n 20:\t\tdepends on OF\n 21:\t\thelp\n 22:\t\t Select to enable support for registering switches configured\n 23:\t\t through MDIO.\n 24:\t\n 25:\tconfig NET_DSA_REALTEK_SMI\n 26:\t\tbool \"Realtek SMI interface support\"\n 27:\t\tdepends on OF\n 28:\t\thelp\n 29:\t\t Select to enable support for registering switches connected\n 30:\t\t through SMI.\n 31:\t\n 32:\tconfig NET_DSA_REALTEK_RTL8365MB\n 33:\t\ttristate \"Realtek RTL8365MB switch driver\"\n 34:\t\tdepends on NET_DSA_REALTEK_SMI || NET_DSA_REALTEK_MDIO\n 35:\t\tselect NET_DSA_TAG_RTL8_4\n 36:\t\thelp\n 37:\t\t Select to enable support for Realtek RTL8365MB-VC and RTL8367S.\n 38:\t\n 39:\tconfig NET_DSA_REALTEK_RTL8366RB\n 40:\t\ttristate \"Realtek RTL8366RB switch driver\"\n 41:\t\tdepends on NET_DSA_REALTEK_SMI || NET_DSA_REALTEK_MDIO\n 42:\t\tselect NET_DSA_TAG_RTL4_A\n 43:\t\thelp\n 44:\t\t Select to enable support for Realtek RTL8366RB.\n 45:\t\n 46:\tconfig NET_DSA_REALTEK_RTL8366RB_LEDS\n 47:\t\tbool\n 48:\t\tdepends on (LEDS_CLASS=y || LEDS_CLASS=NET_DSA_REALTEK_RTL8366RB)\n 49:\t\tdepends on NET_DSA_REALTEK_RTL8366RB\n 50:\t\tdefault NET_DSA_REALTEK_RTL8366RB\n 51:\t\n 52:\tendif\n"
} |
| 7/2 | 2026/10/03 03:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21382 output: 108 thoughts: 1353 Thoughts: **Analysis of the Realtek RTL8365MB Switch Driver Patch** Okay, let's break this down. First, this patch is targeting the Realtek RTL8365MB switch driver. This driver is dependent on `NET_DSA_REALTEK_SMI` or `NET_DSA_REALTEK_MDIO`, and both of those, in turn, rely on `OF`, meaning Open Firmware/Device Tree. This immediately tells me we're dealing with a driver for *physical* Ethernet switch hardware, connected via SMI or MDIO. In standard virtualization environments like QEMU or Google Compute Engine, we *do not* have, and generally do not emulate, this specific hardware. Looking at the patch itself, the changes are limited to `#define` macros within `rtl8365mb_main.c` and `rtl8365mb_vlan.c`. Let's verify that no actual executable code has been touched – which is the case. The diff is exclusively about `#define` macros. Specifically, in `rtl8365mb_main.c`, we see a series of lines starting with `#define` being changed. It's the same in `rtl8365mb_vlan.c`, where we see similar changes. It is only about changing hex masks to more readable `BIT()` and `GENMASK()` macros, or simplifying by using named macros like `#define RTL8365MB_PORT_MASK GENMASK(10, 0)`. Let me quickly confirm the math here... Yep, `GENMASK(10, 0)` is indeed 0x7FF, `GENMASK(4, 0)` is 0x1F, etc. The results are the same. This means the *compiled* values are exactly the same as before. There's zero change in the compiled binary or the C logic. In short, we have: 1. A driver for physical Realtek switch hardware (RTL8365MB) on MDIO/SMI bus, requiring Device Tree. 2. Purely cosmetic macro changes (refactoring) with identical compiled values, *no* executable code changes. Now, let's apply the WorthFuzzing criteria. The patch meets *both* negative criteria: 1. The changes are strictly cosmetic macro refactoring where the compiled values are identical (no executable logic changes whatsoever). 2. The driver is for physical Realtek Ethernet switch chips (RTL8365MB) requiring physical hardware connected over MDIO/SMI buses, which is structurally unreachable in standard virtualized fuzzing environments. Therefore, `WorthFuzzing` should be `false`. Now, according to the schema: - `WorthFuzzing`: false - `Reasoning`: Provide clear, concise explanation. - `EnableConfigs`: empty array or null (when WorthFuzzing=false) - `FocusSymbols`: empty array or null (when WorthFuzzing=false) I will call the `set-results` tool now. |
| 8/2 | 2026/10/03 03:59 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch only performs cosmetic refactoring of register bitmask macros in the Realtek RTL8365MB switch driver, converting raw hex constants to BIT() and GENMASK() without modifying any executable C logic or runtime behavior. Furthermore, the driver targets physical Realtek switch ASICs (connected via SMI/MDIO) that are structurally unreachable in standard virtualized fuzzing environments.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only performs cosmetic refactoring of register bitmask macros in the Realtek RTL8365MB switch driver, converting raw hex constants to BIT() and GENMASK() without modifying any executable C logic or runtime behavior. Furthermore, the driver targets physical Realtek switch ASICs (connected via SMI/MDIO) that are structurally unreachable in standard virtualized fuzzing environments.",
"WorthFuzzing": false
} |
| 9/1 | 2026/10/03 03:59 | 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) |
|---|