From patchwork Wed Mar 13 03:48:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qingfang Deng X-Patchwork-Id: 1911480 X-Patchwork-Delegate: gch981213@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=mtwSm8c6; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=cJ0WDolL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tvc4W2g0tz1yWt for ; Wed, 13 Mar 2024 14:51:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YQvu6sOWdP5Rpiy2LpnaODM7Jg68sjWTTePHTIRoV8k=; b=mtwSm8c6Z1/gKt XQk+rp6iYusfsuF9MqjOfDslvucs5LbxrsVusYJ70Jl+sxP4760Meg+At0tD8xtmecD7ct9Jr3+ED IJKuV6RSeyEmTscf8CFP0fGv6AunHmeJuijILawUUPcKC5tDvMERK3/YLs5iXJfwjZMxkSDizmyI7 JOiziYUcllxV+XQxcOPzwUu1T3UErqkVis3O+HJxFt+KaLMr79bTlPqfi1tJo4i0BiVTieQcLgp/t xyUR3kohPXXwJ49k1H5rixGtst2CJfG8afpylMS/uzytnRsKUtbv6l7VOwVCG0wHKnI6Z7YH/Wstm UekDRZ7uCzVyDNu/ZtLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkFcK-00000008gxg-0wmN; Wed, 13 Mar 2024 03:49:24 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkFcD-00000008gwv-3rhy for openwrt-devel@lists.openwrt.org; Wed, 13 Mar 2024 03:49:19 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1dd59b95677so37074775ad.1 for ; Tue, 12 Mar 2024 20:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710301754; x=1710906554; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IaXz/QssJLI3djXxgKmkW8ougNVDzEPkyDhl+lEugOY=; b=cJ0WDolLiRSj2Jn9ZkcIu8g93sWL6bNnVREpZU49LtYzHFWd2N6psJI8a2nlzG+1Xw cCAoSIlh1zbLt5LwJ38YuKm7SEGp/6NkD/sGg8xC/ebxActBSCgvnYSdgCQM7yNNxeDe zZYUvIlxR6KHHtgD4hC6L8EwowVkAKFuU97q1VhJZ3KlHvSoMcX4Ko5rm8A1QT+RFdUz MA6E3relCkIA03QX1U2ZINWxFG6r6Mp3Aern+1kgWJ9Dsz36OG9XImLmSwok/OuwsRwd rXoNZDIf6682SNHmmP90ycWsgZDmgcESBDM/px8av/0cwtTRXsATR0xcLW0qh7Pxz+pJ Srsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710301754; x=1710906554; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IaXz/QssJLI3djXxgKmkW8ougNVDzEPkyDhl+lEugOY=; b=XIuQ/efbeTx1jshS2zMtVJVKqn6Ew8WCOCdOUSsM81mgqig6Ehk9ILl4Z+oWdh1fUT cmzgRdiZSIQ6H1MP/nzPmTzDo0h/X5qboP4L9jw+H8AQItXqwtnjc7D3fjCFNc9ixLSm 3w1BpKeayk6Zre9LEB5zvWSzluDD3YY+qnDcmpAxhjfbeJ1rhw1LyQh73gLjLV6g83SL k7P7cwTigllaTlcu8hkABbQ4+F9ZOSQ1XzjUx3DBrMhvmYqkWWgPLYwkmCEaMt6n+FMP fln5TK971QcLaS6SWhW487EHJ5m0pruCiGRuxOH2sq6MN1VRhGRKRp/4OFHVpf/1Hayd t/qw== X-Gm-Message-State: AOJu0YzxSg0ukOQb+Mtza4m9Dwf8Ie8yMbO+tYN7RT/08TQAPNd/WcTg V+JeHqViV6xrUddOdf4+dnmGUMcnVqlF+lSqYfDiKKbOVvW2vyJsE979DBnQM1+xZvHx X-Google-Smtp-Source: AGHT+IH3ufqsJBdv6hng2rJV0lL05b14zx+o+uc5Axar9974504ggmg/sXdnkMB8+1zKtgqPIiwv7g== X-Received: by 2002:a17:902:da8b:b0:1dd:96cb:ddf1 with SMTP id j11-20020a170902da8b00b001dd96cbddf1mr9177193plx.2.1710301754193; Tue, 12 Mar 2024 20:49:14 -0700 (PDT) Received: from DESKTOP-4R0U3NR.siflower.com ([2a09:bac5:6249:183c::26a:36]) by smtp.gmail.com with ESMTPSA id u5-20020a170902e80500b001dd998927c6sm5194457plg.26.2024.03.12.20.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 20:49:13 -0700 (PDT) From: Qingfang Deng To: openwrt-devel@lists.openwrt.org Cc: Qingfang Deng , Felix Fietkau Subject: [PATCH] kernel: xt_FLOWOFFLOAD: fix use of uninitialized dir variable Date: Wed, 13 Mar 2024 11:48:44 +0800 Message-Id: <20240313034844.478527-1-dqfext@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_204917_996623_CEB3483B X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Qingfang Deng The dir variable has been used uninitialized since the port to 5.10, and somehow this remains undetected by GCC. Fixes: b10d6044599d ("kernel: add linux 5.10 support") Signed-off-by: Qingfang Deng --- .../hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch | 4 ++-- .../hack-6.1/650-netfilter-add-xt_FLOWOFF [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:634 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [dqfext(at)gmail.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Qingfang Deng The dir variable has been used uninitialized since the port to 5.10, and somehow this remains undetected by GCC. Fixes: b10d6044599d ("kernel: add linux 5.10 support") Signed-off-by: Qingfang Deng --- .../hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch | 4 ++-- .../hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch | 4 ++-- .../hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index da60334498..ec887539d5 100644 --- a/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -609,6 +609,8 @@ Signed-off-by: Felix Fietkau + if (!nf_ct_is_confirmed(ct)) + return XT_CONTINUE; + ++ dir = CTINFO2DIR(ctinfo); ++ + devs[dir] = xt_out(par); + devs[!dir] = xt_in(par); + @@ -618,8 +620,6 @@ Signed-off-by: Felix Fietkau + if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status)) + return XT_CONTINUE; + -+ dir = CTINFO2DIR(ctinfo); -+ + if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0) + goto err_flow_route; + diff --git a/target/linux/generic/hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index aee845d984..6fdfc79207 100644 --- a/target/linux/generic/hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -555,6 +555,8 @@ Signed-off-by: Felix Fietkau + if (!nf_ct_is_confirmed(ct)) + return XT_CONTINUE; + ++ dir = CTINFO2DIR(ctinfo); ++ + devs[dir] = xt_out(par); + devs[!dir] = xt_in(par); + @@ -564,8 +566,6 @@ Signed-off-by: Felix Fietkau + if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status)) + return XT_CONTINUE; + -+ dir = CTINFO2DIR(ctinfo); -+ + if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0) + goto err_flow_route; + diff --git a/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index b9a87a671e..9735983212 100644 --- a/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -555,6 +555,8 @@ Signed-off-by: Felix Fietkau + if (!nf_ct_is_confirmed(ct)) + return XT_CONTINUE; + ++ dir = CTINFO2DIR(ctinfo); ++ + devs[dir] = xt_out(par); + devs[!dir] = xt_in(par); + @@ -564,8 +566,6 @@ Signed-off-by: Felix Fietkau + if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status)) + return XT_CONTINUE; + -+ dir = CTINFO2DIR(ctinfo); -+ + if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0) + goto err_flow_route; +