RE: [PATCH net-next v12 5/5] net: wangxun: add pcie error handler
Jiawen Wu <[email protected]>
| Newsgroups | org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
> > Simon says: I think the issue below can be looked at in the context > > of possible follow-up. > > I'll consider handling this in another patch. > > > > > [Severity: High] > > This is a pre-existing issue, but does failing to open the device in > > txgbe_open() lead to a NULL pointer dereference on subsequent open attempts? > > > > If txgbe_open() encounters an error, the error path calls > > wx_reset_interrupt_capability(), which frees wx->msix_q_entries and sets > > it to NULL. > > > > If a user subsequently attempts to bring the interface up again, > > txgbe_request_queue_irqs() is called, which dereferences the NULL > > wx->msix_q_entries array. > > > > > wx_ptp_stop(wx); > > > txgbe_down(wx); > > After checking the code closely, I think Sashiko is overstated here. wx_reset_interrupt_capability() called pci_free_irq_vectors() which set pdev->msix_enabled = 0. And this would prevent wx->msix_q_entries from being used in txgbe_request_queue_irqs().