From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAE42A034C for ; Fri, 25 Feb 2022 18:17:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B640641150; Fri, 25 Feb 2022 18:17:14 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 6FFB9410FD for ; Fri, 25 Feb 2022 18:17:13 +0100 (CET) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 54C0C3FCAC for ; Fri, 25 Feb 2022 17:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645809433; bh=249WASYHxswaF7FNwuBD8cgq8G0dpkSDWTkc7SkpfyQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=wQZA6bsimk8uGnVbBoZ/DyQy1EPGq1FOFfssVrIhpZ0njdsVe/EG/JqNzylyTj2ho 5GFg+2Yh/64o/aOUrAajrBfx35fS9w+5C69Kfe9uZ8Baej1yaXyUXPHmdEYlGfjneG 3bSBbh1tSvPkf5Y5KULVHG1Qqko6wiGjurUFEb32SfHh4vzVj/L3yfdtWeeQiH0A2L 3yC/X7vUnJp41f16ScmC9gJSD7Ma6SVk76CxdW/Xn5GkzBVVk/emyfUNt0tGMY5qOI dm+WMhwpOuspU/AShilXV830ZjlGM7X7MaWengpyJoF1JRvoqHdPjihf9Hg8fygVfa l9uXdQa6/+39w== Received: by mail-wm1-f69.google.com with SMTP id w3-20020a7bc743000000b0037c5168b3c4so1832957wmk.7 for ; Fri, 25 Feb 2022 09:17:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=249WASYHxswaF7FNwuBD8cgq8G0dpkSDWTkc7SkpfyQ=; b=bK/oF/nx/7BIY/k2DJKxPI0fylFrwc/x3lQ1FKGBpVJ5nDqCANcICE9X3MRHFGXTYs SfYpmG83TiJBHRAFrApLeUGM2orMo2mR2+TlFnI5jtXYfYjKMes4jrFTSkk9IQS7fRFo rG9q2VAJ62omYPvFBrc0NB8rbT63s7vBC1MTg4d7jT6KXKOp8wUhwmKWrasBYs6jkBW4 xWzVMuZ0yMeq9S5tP5koAmjciDBc5I3j2UZ8C38IXrJ6fe46bc/uSmRxESXeYN6/EQku 51srO1B9okj8vxIwkaT+x7W3m2WB0n0QuPrLFyGFxMMTfRj/TERhTEk8LzF7ceYUSeJg c4Ig== X-Gm-Message-State: AOAM530nbOiwyCLtTv1E2FgDpfSQJVBirqEhJ7AfqMj1dqNnWSs7U4Y9 JNlRHXEGk3pNYUF6Ol590LVf/bXm0Q7d/VpqP0SqzVkIb22vgkopN+Rx3BBrcXHak1IKxoR/M6t ZS4q35tDy6NZo9jToY2DcBGQB X-Received: by 2002:adf:e28f:0:b0:1e7:cf02:2d28 with SMTP id v15-20020adfe28f000000b001e7cf022d28mr7121952wri.232.1645809432710; Fri, 25 Feb 2022 09:17:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1sdt5RXtgr0aF0koMEfvtoIJCR7c0MhA2XS1t7Mw7dNLx9dOFpl1k9X1YPGIXpoaigBShhQ== X-Received: by 2002:adf:e28f:0:b0:1e7:cf02:2d28 with SMTP id v15-20020adfe28f000000b001e7cf022d28mr7121940wri.232.1645809432518; Fri, 25 Feb 2022 09:17:12 -0800 (PST) Received: from Keschdeichel.fritz.box (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id t8-20020a5d6908000000b001e3169cc6afsm2823779wru.94.2022.02.25.09.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 09:17:12 -0800 (PST) From: christian.ehrhardt@canonical.com To: Yunjian Wang Cc: Chenbo Xia , dpdk stable Subject: patch 'net/virtio-user: check FD flags getting failure' has been queued to stable release 19.11.12 Date: Fri, 25 Feb 2022 18:15:21 +0100 Message-Id: <20220225171550.3499040-28-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> References: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 19.11.12 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/27/22. So please shout if anyone has objections. 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. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/9a6321719c1bb602e651b171b77c8f04491313db Thanks. Christian Ehrhardt --- >From 9a6321719c1bb602e651b171b77c8f04491313db Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Sat, 8 Jan 2022 15:52:31 +0800 Subject: [PATCH] net/virtio-user: check FD flags getting failure [ upstream commit 6abf10a21b293cb427ef21c59f490592717cb211 ] The function fcntl() could return errors, the return value need to be checked. Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer") Signed-off-by: Yunjian Wang Reviewed-by: Chenbo Xia --- drivers/net/virtio/virtio_user/vhost_user.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c index d8e083ba8b..b4e8ec4b4b 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -422,8 +422,10 @@ vhost_user_setup(struct virtio_user_dev *dev) } flag = fcntl(fd, F_GETFD); - if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0) - PMD_DRV_LOG(WARNING, "fcntl failed, %s", strerror(errno)); + if (flag == -1) + PMD_DRV_LOG(WARNING, "fcntl get fd failed, %s", strerror(errno)); + else if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0) + PMD_DRV_LOG(WARNING, "fcntl set fd failed, %s", strerror(errno)); memset(&un, 0, sizeof(un)); un.sun_family = AF_UNIX; -- 2.35.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-25 16:58:45.354405248 +0100 +++ 0028-net-virtio-user-check-FD-flags-getting-failure.patch 2022-02-25 16:58:44.236990409 +0100 @@ -1 +1 @@ -From 6abf10a21b293cb427ef21c59f490592717cb211 Mon Sep 17 00:00:00 2001 +From 9a6321719c1bb602e651b171b77c8f04491313db Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6abf10a21b293cb427ef21c59f490592717cb211 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index cc830a660f..0a39393c45 100644 +index d8e083ba8b..b4e8ec4b4b 100644 @@ -22 +23 @@ -@@ -840,8 +840,10 @@ vhost_user_setup(struct virtio_user_dev *dev) +@@ -422,8 +422,10 @@ vhost_user_setup(struct virtio_user_dev *dev)