Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4660629pxb; Thu, 14 Oct 2021 09:27:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRyLj/uIXBHuxDcqjP8jCtHsHabYNtOTjp8vjKUQpekaP4bIAzNwsukLiqDPf9O3si05Z+ X-Received: by 2002:a17:90a:d24d:: with SMTP id o13mr21653299pjw.59.1634228846707; Thu, 14 Oct 2021 09:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634228846; cv=none; d=google.com; s=arc-20160816; b=jrLuK1pOwGpOUjYWxr6tB30dcBaNXHBFuTIG073YVgctoDFTBy5MR0WCrUdE2VMXnp mSnDJmO2o5HTRnGHBZpyMEhMHsroJKiFY1tslshxBksYDZFfQEJ8km4S3VXL2UojcE2E 3IyUuUWDeLnxayA0B8cvTDhuj1qy38g4uIN3iwYqUkcTeVR4p2E6fnUkUxv7mzzqRRE0 DWY7Rdj4HzZaKcP1sbNTr1Y38D6fKskKuCeOtL7MY70EPvEiHnjgOLikdMZfC56Rw8eI 5DnXErXc0rReC3doYHKgbvJVnHaRDGO4Hs9zWHh6w2ahBUbSeiXzqkQMuZ6hdHgr/ydf c5Ag== 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=ERvA/fZdRJ/PPzu7u9+toUm8PLPGQbECIATp6UXkxOw=; b=vsmoOwL0jMA9fb1y7kvygZ5p1+3Rzu9vOMVHDLjdS6JFm1tNQgePfk2Gi81SZq25Q8 v+WAElCUWva4Ru6cEXIirUWgVoTuOOZhK2YQMvPaPt4dVvkAAJbaGBMJUix6gmPcqqJl ZAufYRfWUhMmZVeJkij64K6pftcReYagW9m3dPy/n7H4t2q508Y2uggySVmMlD8/BkzQ Wgj7xrWp1Wrla20oHPPnUWoWHCT4y4C9lBBunjiXpLGzc5pmCSFWO6m7N1dcjX6HEOSq CKteqkz4+WnhBOdbBRk77yQS98SnRPEi2XDLRYqUjSbK0/pxm42XuuuiSoTwJ52E4uyx alyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yGnXf2Vt; 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 s7si4045208plr.455.2021.10.14.09.27.14; Thu, 14 Oct 2021 09:27:26 -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=yGnXf2Vt; 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 S231624AbhJNO5L (ORCPT + 99 others); Thu, 14 Oct 2021 10:57:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:41914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231958AbhJNO5H (ORCPT ); Thu, 14 Oct 2021 10:57:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D7D9610F8; Thu, 14 Oct 2021 14:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634223302; bh=oxs1XX/d9h13Vh7Lz/iK0iOZ0KydbxH4gzup2ehGJMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yGnXf2VtiIURiSqi1wxovpZNbTeueNsGva6UvlHNRaV5f9hP6A+4XU3vXfJsrfk8C yIPTahExv7GwvK6jHzUHehU6xSeqdcx+8VGocifkazsJmKWww/L34uGzJ46sjOCkva ubqKaccmT8p950wslv/qNOciAEtod6HoJ1WPfP74= 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 4.4 14/18] netfilter: ip6_tables: zero-initialize fragment offset Date: Thu, 14 Oct 2021 16:53:46 +0200 Message-Id: <20211014145206.782356107@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211014145206.330102860@linuxfoundation.org> References: <20211014145206.330102860@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 3057356cfdff..43d26625b80f 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -339,6 +339,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.net = state->net; acpar.in = state->in; -- 2.33.0