DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/1] net/bnx2x: fix segfaults due to stale interrupt status
@ 2019-02-21 19:24 Shahed Shaikh
  2019-02-25 14:47 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Shahed Shaikh @ 2019-02-21 19:24 UTC (permalink / raw)
  To: dev; +Cc: rmody, ferruh.yigit, stable

Previous ungraceful exit may leave behind un-acked stale
interrupts for slowpath and fastpath.

Interrupt status polling function is started before FLR is
initiated, so we don't have a real way to protect this polling
function invoking an interrupt handler caused due to stale
interrupt status from previous ungraceful exit.

So, check uninitialized status block variables in interrupt
handling path which may lead to sefault.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
---
 drivers/net/bnx2x/bnx2x.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 4c775c1..26b3828 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -4201,6 +4201,9 @@ static uint16_t bnx2x_update_dsb_idx(struct bnx2x_softc *sc)
 	struct host_sp_status_block *def_sb = sc->def_sb;
 	uint16_t rc = 0;
 
+	if (!def_sb)
+		return 0;
+
 	mb();			/* status block is written to by the chip */
 
 	if (sc->def_att_idx != def_sb->atten_status_block.attn_bits_index) {
@@ -4525,6 +4528,10 @@ static void bnx2x_handle_fp_tq(struct bnx2x_fastpath *fp, int scan_fp)
 	struct bnx2x_softc *sc = fp->sc;
 	uint8_t more_rx = FALSE;
 
+	/* Make sure FP is initialized */
+	if (!fp->sb_running_index)
+		return;
+
 	PMD_DEBUG_PERIODIC_LOG(DEBUG, sc,
 			       "---> FP TASK QUEUE (%d) <--", fp->index);
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH 1/1] net/bnx2x: fix segfaults due to stale interrupt status
  2019-02-21 19:24 [dpdk-dev] [PATCH 1/1] net/bnx2x: fix segfaults due to stale interrupt status Shahed Shaikh
@ 2019-02-25 14:47 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-02-25 14:47 UTC (permalink / raw)
  To: Shahed Shaikh, dev; +Cc: rmody, stable

On 2/21/2019 7:24 PM, Shahed Shaikh wrote:
> Previous ungraceful exit may leave behind un-acked stale
> interrupts for slowpath and fastpath.
> 
> Interrupt status polling function is started before FLR is
> initiated, so we don't have a real way to protect this polling
> function invoking an interrupt handler caused due to stale
> interrupt status from previous ungraceful exit.
> 
> So, check uninitialized status block variables in interrupt
> handling path which may lead to sefault.
> 
> Fixes: 540a211084a7 ("bnx2x: driver core")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-25 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 19:24 [dpdk-dev] [PATCH 1/1] net/bnx2x: fix segfaults due to stale interrupt status Shahed Shaikh
2019-02-25 14:47 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).