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 3CDF8A0613 for ; Tue, 23 Jul 2019 03:03:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 182121BFE0; Tue, 23 Jul 2019 03:03:56 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id E8AAA1BFD8 for ; Tue, 23 Jul 2019 03:03:54 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:03:52 +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 x6N11HgD026580; Tue, 23 Jul 2019 04:03:51 +0300 From: Yongseok Koh To: Bruce Richardson Cc: Tiwei Bie , dpdk stable Date: Mon, 22 Jul 2019 18:00:54 -0700 Message-Id: <20190723010115.6446-87-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 'examples/vhost_scsi: fix null-check for parameter' 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 8ceef396b56d3332852315afb5eacecf84692ec3 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 8 Apr 2019 10:46:37 +0100 Subject: [PATCH] examples/vhost_scsi: fix null-check for parameter [ upstream commit 6fd5b5734faf2f902aebf57e966e5adb0499a1ff ] Coverity points out that there is a check in the main thread loop for the ctrlr->bdev being NULL, but by that stage the pointer has already been dereferenced. Therefore, for safety, before we enter the loop do an initial check on the parameter structure. Coverity issue: 158657 Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample app") Signed-off-by: Bruce Richardson Reviewed-by: Tiwei Bie --- examples/vhost_scsi/vhost_scsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/vhost_scsi/vhost_scsi.c b/examples/vhost_scsi/vhost_scsi.c index b40f993639..afa96e237c 100644 --- a/examples/vhost_scsi/vhost_scsi.c +++ b/examples/vhost_scsi/vhost_scsi.c @@ -315,6 +315,12 @@ ctrlr_worker(void *arg) cpu_set_t cpuset; pthread_t thread; + if (ctrlr == NULL || ctrlr->bdev == NULL) { + fprintf(stderr, "%s: Error, invalid argument passed to worker thread\n", + __func__); + exit(0); + } + thread = pthread_self(); CPU_ZERO(&cpuset); CPU_SET(0, &cpuset); -- 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-07-22 17:55:11.169858753 -0700 +++ 0087-examples-vhost_scsi-fix-null-check-for-parameter.patch 2019-07-22 17:55:06.411476000 -0700 @@ -1,8 +1,10 @@ -From 6fd5b5734faf2f902aebf57e966e5adb0499a1ff Mon Sep 17 00:00:00 2001 +From 8ceef396b56d3332852315afb5eacecf84692ec3 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 8 Apr 2019 10:46:37 +0100 Subject: [PATCH] examples/vhost_scsi: fix null-check for parameter +[ upstream commit 6fd5b5734faf2f902aebf57e966e5adb0499a1ff ] + Coverity points out that there is a check in the main thread loop for the ctrlr->bdev being NULL, but by that stage the pointer has already been dereferenced. Therefore, for safety, before we enter the loop do an @@ -10,7 +12,6 @@ Coverity issue: 158657 Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample app") -Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Reviewed-by: Tiwei Bie @@ -19,10 +20,10 @@ 1 file changed, 6 insertions(+) diff --git a/examples/vhost_scsi/vhost_scsi.c b/examples/vhost_scsi/vhost_scsi.c -index 2908ff68b7..513af0cca4 100644 +index b40f993639..afa96e237c 100644 --- a/examples/vhost_scsi/vhost_scsi.c +++ b/examples/vhost_scsi/vhost_scsi.c -@@ -285,6 +285,12 @@ ctrlr_worker(void *arg) +@@ -315,6 +315,12 @@ ctrlr_worker(void *arg) cpu_set_t cpuset; pthread_t thread;