Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4727417pxb; Thu, 14 Oct 2021 10:44:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7XbVgnM9jB7i7ezXGUAE8AeVNVq8CwW67upg/Fa/LtyegsiH1uKG9F11IQA9+y6V8mi8P X-Received: by 2002:a17:902:a613:b0:13d:d95c:c892 with SMTP id u19-20020a170902a61300b0013dd95cc892mr6286545plq.35.1634233444332; Thu, 14 Oct 2021 10:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634233444; cv=none; d=google.com; s=arc-20160816; b=lgEfxiMHoXEVVtC5oNnoi6sPZOCiWC/0kc1jZO9QT0xM44mORoI1RwVv91z2ZP1wRO 5S6nTJeMgMqjk4XVh0w/+ytAO9W+eZgNU1NbcK/F4HmrXfocYcjJ0Ziub66ltb56lPpG GiH8iS1atY+vqroqh9JB+8eIeKfYrWd+PqteS/esS2SOe1qQxYXNuUeNsLSmZRAp5xGM vw2kLoyuI4BdtHEEoMlaMzDm3x2a5D/+SBtXCU9eiXR3ODIgDaSeer0L34Y6vQAqno8B VlFLQG7BpEG+Zc7XlApgTuJYHmQXzYn3CPuO5eiMOAd3V28xi736otGyJufTUmU+R4dS C8iw== 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=hPkDXJQWdl6oKQNK/xdhw79eS9s4fz3hZfWPH+aHUQg=; b=DBwobC4GwAiQ4YWRJE8pWOHTh/Zm4vur3b0eUfqoZT3wrEyy5788xoROp179DuDl6t +WQ99OFpo2aT+A6GWMdWrn2NbemgzQNEQbC2niKqZFQwrMMW4sFotTgJLUzC+KwyClHz LUqWXs5E6bFqxFsufUG71eZaYO7rcooM+a1lTrlnzQri7eQbwfidzbm4BzDUae1VN0mB jibHentIMpjdL4WyYaZm1Pq6SlKesVZSjUVSQgXMadiRLDJUT6ITUjKuS/ut7PlGUl0c UPx2xHvk4y3azqN+VDK901SlaeJyekcILUqt5dkPOTjP4XQXrK8aJdtRBEtH9lCHvU2U eaEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jdzKDota; 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 h7si3998216pjj.101.2021.10.14.10.43.51; Thu, 14 Oct 2021 10:44:04 -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=jdzKDota; 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 S232621AbhJNPDl (ORCPT + 99 others); Thu, 14 Oct 2021 11:03:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:45236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233225AbhJNPCH (ORCPT ); Thu, 14 Oct 2021 11:02:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7502461151; Thu, 14 Oct 2021 14:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634223553; bh=Qxx686P8vUb6GPouCQmVlT+kTMmeQTNFJe7SNq54ACk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jdzKDotauReBoq9q9CEDKsBFz3VOHg/Mo7cxc51hSKQXGCwjFxN+bkXlIvhClkroI aonZ4o+eL8hfPDBXT35+vXJSSl5Up9T0BYgQiF8vmym8oXwFz0PLMbWTLfcGr5G2cR idmZYkeUOfONXFzPWBGKquw9IJf3LS8u2MewQLDM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeremy Sowden , Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.4 04/16] netfilter: ip6_tables: zero-initialize fragment offset Date: Thu, 14 Oct 2021 16:54:07 +0200 Message-Id: <20211014145207.463875310@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211014145207.314256898@linuxfoundation.org> References: <20211014145207.314256898@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: Jeremy Sowden [ Upstream commit 310e2d43c3ad429c1fba4b175806cf1f55ed73a6 ] ip6tables only sets the `IP6T_F_PROTO` flag on a rule if a protocol is specified (`-p tcp`, for example). However, if the flag is not set, `ip6_packet_match` doesn't call `ipv6_find_hdr` for the skb, in which case the fragment offset is left uninitialized and a garbage value is passed to each matcher. Signed-off-by: Jeremy Sowden Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/ipv6/netfilter/ip6_tables.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 8bb543b0e775..41268612bdd4 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -273,6 +273,7 @@ ip6t_do_table(struct sk_buff *skb, * things we don't know, ie. tcp syn flag or ports). If the * rule is also a fragment-specific rule, non-fragments won't * match it. */ + acpar.fragoff = 0; acpar.hotdrop = false; acpar.state = state; -- 2.33.0