From patchwork Thu Jul 22 16:31:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 484552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDC54C63799 for ; Thu, 22 Jul 2021 16:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAD1F6135F for ; Thu, 22 Jul 2021 16:34:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230420AbhGVPyJ (ORCPT ); Thu, 22 Jul 2021 11:54:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:57424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbhGVPyB (ORCPT ); Thu, 22 Jul 2021 11:54:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 55AA261363; Thu, 22 Jul 2021 16:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626971675; bh=/aOm63D165gNBSlu0Y0NQNDl3CrxydhCFx+o6586obc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yIVLRoFEq3jGrX2dh/eC6eSYPRryKDN3YvKQXGII4MZ3OFhfWeZK0jE35ID+uN08e i6i2U2WS8pUjrwdaLPUUJmxhArN4dc7pl/45A6lUAElDcmXln02cd0sHjBtAp5dxar HY4nkkomxLCICBEAN2zPmFdY2zHTO0bjleYZWSt4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, wenxu , "David S. Miller" Subject: [PATCH 5.4 56/71] net/sched: act_ct: fix err check for nf_conntrack_confirm Date: Thu, 22 Jul 2021 18:31:31 +0200 Message-Id: <20210722155619.765430454@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210722155617.865866034@linuxfoundation.org> References: <20210722155617.865866034@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: wenxu commit 8955b90c3cdad199137809aac8ccbbb585355913 upstream. The confirm operation should be checked. If there are any failed, the packet should be dropped like in ovs and netfilter. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: wenxu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/act_ct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -474,7 +474,8 @@ static int tcf_ct_act(struct sk_buff *sk /* This will take care of sending queued events * even if the connection is already confirmed. */ - nf_conntrack_confirm(skb); + if (nf_conntrack_confirm(skb) != NF_ACCEPT) + goto drop; } out_push: