From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2AA92A046B for ; Tue, 23 Jul 2019 03:01:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 23B4A1BECB; Tue, 23 Jul 2019 03:01:46 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C37991BEDA for ; Tue, 23 Jul 2019 03:01:44 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:01:41 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6N11Hf0026580; Tue, 23 Jul 2019 04:01:40 +0300 From: Yongseok Koh To: Shahed Shaikh Cc: dpdk stable Date: Mon, 22 Jul 2019 17:59:41 -0700 Message-Id: <20190723010115.6446-14-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com> References: <20190723010115.6446-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnx2x: fix segfaults due to stale interrupt status' has been queued to LTS release 17.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 07/27/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Yongseok --- >From fce7da402eb64d51bf747daef7c033d704249535 Mon Sep 17 00:00:00 2001 From: Shahed Shaikh Date: Thu, 21 Feb 2019 11:24:44 -0800 Subject: [PATCH] net/bnx2x: fix segfaults due to stale interrupt status [ upstream commit 797ed9916ac73efc8f3d0b1a9a354d50948566c9 ] 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 segfault. Fixes: 540a211084a7 ("bnx2x: driver core") Signed-off-by: Shahed Shaikh --- 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 b51a38d22e..15bc0d67c3 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -4207,6 +4207,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) { @@ -4531,6 +4534,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.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-07-22 17:55:07.279401690 -0700 +++ 0014-net-bnx2x-fix-segfaults-due-to-stale-interrupt-statu.patch 2019-07-22 17:55:05.835468000 -0700 @@ -1,8 +1,10 @@ -From 797ed9916ac73efc8f3d0b1a9a354d50948566c9 Mon Sep 17 00:00:00 2001 +From fce7da402eb64d51bf747daef7c033d704249535 Mon Sep 17 00:00:00 2001 From: Shahed Shaikh Date: Thu, 21 Feb 2019 11:24:44 -0800 Subject: [PATCH] net/bnx2x: fix segfaults due to stale interrupt status +[ upstream commit 797ed9916ac73efc8f3d0b1a9a354d50948566c9 ] + Previous ungraceful exit may leave behind un-acked stale interrupts for slowpath and fastpath. @@ -15,7 +17,6 @@ handling path which may lead to segfault. Fixes: 540a211084a7 ("bnx2x: driver core") -Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- @@ -23,10 +24,10 @@ 1 file changed, 7 insertions(+) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c -index 4c775c1639..26b3828e89 100644 +index b51a38d22e..15bc0d67c3 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) +@@ -4207,6 +4207,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; @@ -36,7 +37,7 @@ 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) +@@ -4531,6 +4534,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;