From patchwork Mon Feb 1 12:24:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyunjian X-Patchwork-Id: 1434134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DTnFt6gQhz9t1D for ; Mon, 1 Feb 2021 23:25:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6976686FBF; Mon, 1 Feb 2021 12:25:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0EM0erEATPbl; Mon, 1 Feb 2021 12:25:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id AC72286E48; Mon, 1 Feb 2021 12:25:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8C177C0174; Mon, 1 Feb 2021 12:25:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5340EC013A for ; Mon, 1 Feb 2021 12:25:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 391A986E48 for ; Mon, 1 Feb 2021 12:25:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H0KIxmFbahl8 for ; Mon, 1 Feb 2021 12:25:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by hemlock.osuosl.org (Postfix) with ESMTPS id C684D86FAD for ; Mon, 1 Feb 2021 12:25:00 +0000 (UTC) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DTnCr37DMzMTC2; Mon, 1 Feb 2021 20:23:20 +0800 (CST) Received: from localhost (10.174.242.175) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Mon, 1 Feb 2021 20:24:47 +0800 From: wangyunjian To: Date: Mon, 1 Feb 2021 20:24:39 +0800 Message-ID: <1612182279-20400-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.174.242.175] X-CFilter-Loop: Reflected Cc: dev@openvswitch.org, jerry.lilijun@huawei.com, chenchanghu@huawei.com, lvmengfan@huawei.com Subject: [ovs-dev] [PATCH RESEND] dpif-netlink: fix using uninitialized info.tc_modify_flow_deleted in out label X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Yunjian Wang Before info.tc_modify_flow_deleted is assigned a value, error processing of other statements goes to the out label. In the out label, the uninitialized variant is used for condition determination, which may cause uncertain behavior. Fixes: 65b84d4a32bd ("dpif-netlink: avoid netlink modify flow put op failed after tc modify flow put op failed.") Signed-off-by: lvmengfan Signed-off-by: Yunjian Wang --- lib/dpif-netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index ceb56c685..50520f8c0 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -2061,6 +2061,7 @@ parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put) uint8_t csum_on = false; int err; + info.tc_modify_flow_deleted = false; if (put->flags & DPIF_FP_PROBE) { return EOPNOTSUPP; } @@ -2105,7 +2106,6 @@ parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put) info.tunnel_csum_on = csum_on; info.recirc_id_shared_with_tc = (dpif->user_features & OVS_DP_F_TC_RECIRC_SHARING); - info.tc_modify_flow_deleted = false; err = netdev_flow_put(dev, &match, CONST_CAST(struct nlattr *, put->actions), put->actions_len,