Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3422589pxf; Mon, 29 Mar 2021 01:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMCIxfcPnJhi5NcmgcUgMB4spaBaPTTVL8TFbpOnNurGqmmHlr25dWtX14IKaoYWHLyAeO X-Received: by 2002:a17:906:40c9:: with SMTP id a9mr16289048ejk.161.1617007036119; Mon, 29 Mar 2021 01:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007036; cv=none; d=google.com; s=arc-20160816; b=UP6haqyX7TvVvoUiEuswcL2aUfhIX3jL1uCvtolNxhpjnff0B4WocnGHzgvaOc3AtQ w7MiSG6e/YgmWclTsJ+14/c8GPgkvR1uelaZgsubUYtZoj8L3JDFo3AouzT70KqINxmh WyE75pN2Od9ZyAzvyPI3yesfeU81jsPEFoD2iFzI83kTKgN6JCoIU1VKIDDzEDrbc58K w9uSx2oJeuAA8m2YAs7WCR2Z518Pw9/+ChDP6oOYWemahiQuqPZzK5+DXjqb9o6GcazW zgrKddc1a1Vuf4y5C33duP45SA4swbIkcsiHijRgVIwaFNmcaa9nrGbfgO3gl/PD4Um2 Wmng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hgchXRCIHtlQdqvIr93lv7gi7UsPWjnLmmYKiN/yyyM=; b=HcHf5Bhe4tjqmnCr5oTUr1X6st8G3H2ZKGNafzYfX2MxIouomAZOPKOW9V/T0iXpLc vlt3UvRlQCmtS2u1zXDiWxqhdU4a4OPu/ffakUBVq/gos+FSXNx3FfRX5MlshiPAzADc bBGVJg68pU19AQKgOZtrIOmgYcPG84A2jLzZKPyDl/viZtGpO/KIJWyTHLWBBIkbo7Nr cMJouk5+OJADs1950md7SIuvEs1R3b6pGWWRHxn3orfZxDOXyeayxH8VA0ELm3fIgfGp BYV/9JkZFj5QMhVw/HY8yuNgdc3wHr12qFC+gB6xMz4zKfriLQt8XfyKtzvbPdvqrYbn khfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PgTP5AgT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd10si12386913ejc.600.2021.03.29.01.36.53; Mon, 29 Mar 2021 01:37:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PgTP5AgT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234089AbhC2Ifp (ORCPT + 99 others); Mon, 29 Mar 2021 04:35:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:38936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233565AbhC2IVo (ORCPT ); Mon, 29 Mar 2021 04:21:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C16C61477; Mon, 29 Mar 2021 08:21:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006104; bh=oKF2EdFp4LFU64t6o/t8+Ntpy2+vBZHmEEZlUl2iWFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PgTP5AgTQTc25EmW/Z7wX9bJXzXRpTFyB1rKDHiF2wJa3HDMb4bf9J5O+4g+Mt4qF LuqzEbvbFK3UKiMBiWMOcw1FVR9631yKU8hM+7Xue8CCQJF4JnzjlqSXxJ50awKIDt gxzZGguIQR2ntMgLy/RP2lSHENIp6gekPxT5GkQg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.10 119/221] netfilter: ctnetlink: fix dump of the expect mask attribute Date: Mon, 29 Mar 2021 09:57:30 +0200 Message-Id: <20210329075633.180770262@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Westphal [ Upstream commit b58f33d49e426dc66e98ed73afb5d97b15a25f2d ] Before this change, the mask is never included in the netlink message, so "conntrack -E expect" always prints 0.0.0.0. In older kernels the l3num callback struct was passed as argument, based on tuple->src.l3num. After the l3num indirection got removed, the call chain is based on m.src.l3num, but this value is 0xffff. Init l3num to the correct value. Fixes: f957be9d349a3 ("netfilter: conntrack: remove ctnetlink callbacks from l3 protocol trackers") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_conntrack_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 3d0fd33be018..c1bfd8181341 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -2960,6 +2960,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb, memset(&m, 0xFF, sizeof(m)); memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3)); m.src.u.all = mask->src.u.all; + m.src.l3num = tuple->src.l3num; m.dst.protonum = tuple->dst.protonum; nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK); -- 2.30.1