Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 1 · Medium: 0 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [High] The fix is incomplete. -- qlcnic: Fix potential interrupt table leak on setup failure The patch frees ahw->intr_tbl in qlcnic_82xx_mq_intrpt() when qlcnic_82xx_config_intrpt() fails. Without this, a later open would allocate a new table and overwrite the saved pointer.
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c > index ff4f7cd20c791..ddd0c51dca106 100644 > --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c > +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c > @@ -897,10 +897,13 @@ int qlcnic_82xx_mq_intrpt(struct qlcnic_adapter *adapter, int op_type) > } > > err = qlcnic_82xx_config_intrpt(adapter, 1); > - if (err) > + if (err) { > dev_err(&adapter->pdev->dev, > "Failed to configure Interrupt for %d vector\n", > ahw->num_msix); > + vfree(ahw->intr_tbl); > + ahw->intr_tbl = NULL; > + } > return err; > }
[Severity: High] Does this fix cover every place where "a later open allocates another table and overwrites the saved pointer"? qlcnic_82xx_mq_intrpt() assigns a fresh table every time it runs, and never checks for or frees an existing one: ahw->intr_tbl = vzalloc(array_size(sizeof(struct qlcnic_intrpt_config), ahw->num_msix)); It runs on every interface up: __qlcnic_up() qlcnic_fw_create_ctx() qlcnic_82xx_mq_intrpt(dev, 1) The matching teardown on the down path is qlcnic_fw_destroy_ctx() in qlcnic_ctx.c. It sends the firmware DEL but does not free the table: if (qlcnic_82xx_check(adapter) && (adapter->flags & QLCNIC_MSIX_ENABLED) && qlcnic_check_multi_tx(adapter) && !adapter->ahw->diag_test) qlcnic_82xx_config_intrpt(adapter, 0); The err_out path in qlcnic_fw_create_ctx() works the same way when qlcnic_fw_cmd_create_rx_ctx() or qlcnic_fw_cmd_create_tx_ctx() fails after qlcnic_82xx_mq_intrpt() has succeeded: err_out: if (qlcnic_82xx_check(dev) && (dev->flags & QLCNIC_MSIX_ENABLED) && qlcnic_check_multi_tx(dev) && !dev->ahw->diag_test) qlcnic_82xx_config_intrpt(dev, 0); qlcnic_teardown_intr() is the only place that vfree()s the 82xx table. It runs on probe failure, remove, suspend and interrupt re-setup. It does not run on ndo_stop, ndo_open or a context reset. So on an 82xx adapter with MSI-X and multi-TX firmware, wouldn't each of these still leak the previous intr_tbl? - ip link set dev X down / up, via qlcnic_close()->__qlcnic_down() and then qlcnic_open()->__qlcnic_up() - qlcnic_reset_context(), for example from the ethtool set_ringparam path - qlcnic_reset_hw_context(), via qlcnic_down()/qlcnic_up() - qlcnic_diag_free_res(), which clears diag_test and calls __qlcnic_up() again Could the table be freed and set to NULL wherever the firmware DEL is sent, meaning qlcnic_fw_destroy_ctx() and the qlcnic_fw_create_ctx() err_out path? Another option is for qlcnic_82xx_mq_intrpt() to free or reuse any existing table before it allocates a new one.
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40mail.sdu.edu.cn