Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3817068ybi; Mon, 29 Jul 2019 13:12:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyefqu2o8NPHJWSbfjkp4gFNiOW9w6iSBKPEjANg42WX51Xji8VI4n2zXRO7nWM+fQzVghy X-Received: by 2002:a17:90a:1c17:: with SMTP id s23mr114325361pjs.108.1564431124754; Mon, 29 Jul 2019 13:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431124; cv=none; d=google.com; s=arc-20160816; b=KUHkqd//Fqxgv0rtdIZMIMhBOtlXPkpCPiAQKWFwvJkUdi3XjsJbp+vj8hhy4aZcro DQF9T/VghQaHtC3o11ewi3tGki0vXiZ+ulbYaOiXEYwnnVP+a5G4pSfMjPZU7yC2ywDP eCVLKyg8J75Rm3pkDw/x2WYrX9T2ZJv+hAMzUyhixte/u2///9yQy/WmWxIE9QpEP2/k goxeYY1ASAkf+czBikf7z3PhZMvi6K/Ot/LddrF1nMNJmeo46a7feBMDfoianUjN8eeN QrkQOjxQe2l+jrj29aIVgLDror2jpPE7kbfbtlaSzRt0V3hrgiCqMTgRMXdaPMOz34jc NHqA== 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=W5ESh4DKyTTU0doY0FRZjKk2voV2zy6dF+IZI5/6Dt4=; b=wLYPUgYqftU17onHK9aYNEwcdGhcDWXm0MfQk88rfoIwSXvX4LHiLtaj0A0s2R2fyp uBXY5Xe701d2uEsLZ8qtyUdO3vpO73EEYB8dhNIt8OAoi1l+ii2fV58Kj0kluD7dMb1e D+n4ei/ymbg9v6JyQyMFyVgtOu+8sAwxCvqIGW7A7zAUKcI9T/UeEQvJ873XKJ9RXcuS MxQiqmm9/S/ksh9lb4peGSQu2FCzmprPEo4lLXQlv5qDrzgKtzyUdmKuuRiTYxA4aYnw SN76AnKhuijADTW+IOOqMjh5GVyNdiCpemCcwi+oBEIlaOiw44NZ54yAf2SYYj2nPPDG Dn0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pchwhhqf; 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 5si26773987plx.200.2019.07.29.13.11.49; Mon, 29 Jul 2019 13:12:04 -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=pchwhhqf; 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 S2388160AbfG2TeD (ORCPT + 99 others); Mon, 29 Jul 2019 15:34:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:48344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388054AbfG2Td7 (ORCPT ); Mon, 29 Jul 2019 15:33:59 -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 A89BB217D6; Mon, 29 Jul 2019 19:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428838; bh=5NwAp73nKV++WnnHW1SKK5D8ojELMkgVwqolVmj/iTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pchwhhqfqtJFic2T1HgKwliUmJg534ndH3BEragfQh+7++O9uOlXZNf5PyRvsDwGL BPe7XXn0m4STBM/8ofFkMq0HEEu0qwdR6ZYTXeLyRubNzgGgYi1yJnpvQuXrhqh9zb I8tGrfNwtptOTH95sd+n/0pdBMWGMdaxcbA4W6To= 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.14 203/293] net: bridge: mcast: fix stale ipv6 hdr pointer when handling v6 query Date: Mon, 29 Jul 2019 21:21:34 +0200 Message-Id: <20190729190840.031452347@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 @@ -1482,7 +1482,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; @@ -1526,7 +1525,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);