Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1175162ybi; Fri, 2 Aug 2019 10:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwszoisn08YsG9K+ftk4EwlDHDLCpWggnVUo2JT3h1JpU4OYMH0gjqEcgIWhWrpGkFl/CU X-Received: by 2002:a63:510e:: with SMTP id f14mr45426312pgb.422.1564767173512; Fri, 02 Aug 2019 10:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564767173; cv=none; d=google.com; s=arc-20160816; b=zdyomWXq3HkJg1Xn6vi73apEMmOyO+hTxjYqlGBFqs7mmRBLIlyOKkcG4Bl94HrENM JaBmtp+exeqsXGXyGgSQpWKvV5x54Otvz6kLBmSDHjaPIAoqBIjEajWn+FXMRNRREZnI f68yIx5JcPpFnRPkYPQaIurvKDt5lgrFuq92jhSKtupluyVvFytHXhpp/qyVEKhm0OdQ 1oAGNwXDd2n7zoV5Ye8WzTbOYqCazavHg0PGpoQlGrJZZfD+klx5dk5gMteFOnR/ViUR xScCUTqEOOZpDSpY3u/xC1EH2onQCrq68rNnyDkJVRJT3ejG3DQ7kfMkUgtUOov2xBRd lO6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fjkKtPkuPaNW31Cuatth1ETgT71+J5ApXCDrWATI1Co=; b=sSf9E2zDe2nfn5Aq5eVz+J3ncN/T9y6r94Vv0/EAhJkzid0I9R2cTGAeFNyBudt62y 5pyDl91kb+qZjdL4e8lNx/jVBbXiUKNH74A31AJTfutZhWHqvPHMdKLr+wtZmwuiEGlC BnTY6VWmkU/3szdB+4sdGEtWxGO7eULSx9S5gzXyFz0ibarCP5+tpHike41hyuherQXV DOS8mFuR4YpDLiuGb8pRFmbSeyhv7kcfBQNlEDhIClPU0QLbIQo1fyZlekdYIKuf9Mnv Gm/nNWwOMxuKS2H111N7v5wVEQkUu7dDV3S+ZRuN0Y0kc/8FnDC0CFY9JLmdw6jsMjJF zFjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j2J8oZ9C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si34980538plb.177.2019.08.02.10.32.36; Fri, 02 Aug 2019 10:32:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j2J8oZ9C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405681AbfHBJr2 (ORCPT + 99 others); Fri, 2 Aug 2019 05:47:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:52260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405660AbfHBJr0 (ORCPT ); Fri, 2 Aug 2019 05:47:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9826921726; Fri, 2 Aug 2019 09:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739245; bh=NNRDplPKVWxRB5lwH3Z2zjZpvOOx1czUX2WfBcdDDKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j2J8oZ9CQnsUMvbkHFRRhit6Yaol1ZNIaqR2Lg6Eu+8ShFyxQkBFFJw6dKK0CMezu FINoXNodwm7PgMk3+YugvErNVqv8nRyPyJBeG0HPFboO5eM232Dj0LGCflLuKlKJpS x1ZeKlwTH6RJpPIM48eFlWnKcIw6IoQlinYIrmr4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Aleksandrov , Martin Weinelt , "David S. Miller" Subject: [PATCH 4.9 149/223] net: bridge: mcast: fix stale ipv6 hdr pointer when handling v6 query Date: Fri, 2 Aug 2019 11:36:14 +0200 Message-Id: <20190802092248.165485757@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikolay Aleksandrov [ Upstream commit 3b26a5d03d35d8f732d75951218983c0f7f68dff ] We get a pointer to the ipv6 hdr in br_ip6_multicast_query but we may call pskb_may_pull afterwards and end up using a stale pointer. So use the header directly, it's just 1 place where it's needed. Fixes: 08b202b67264 ("bridge br_multicast: IPv6 MLD support.") Signed-off-by: Nikolay Aleksandrov Tested-by: Martin Weinelt Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_multicast.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1379,7 +1379,6 @@ static int br_ip6_multicast_query(struct struct sk_buff *skb, u16 vid) { - const struct ipv6hdr *ip6h = ipv6_hdr(skb); struct mld_msg *mld; struct net_bridge_mdb_entry *mp; struct mld2_query *mld2q; @@ -1423,7 +1422,7 @@ static int br_ip6_multicast_query(struct if (is_general_query) { saddr.proto = htons(ETH_P_IPV6); - saddr.u.ip6 = ip6h->saddr; + saddr.u.ip6 = ipv6_hdr(skb)->saddr; br_multicast_query_received(br, port, &br->ip6_other_query, &saddr, max_delay);