From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A15FC433EC for ; Mon, 20 Jul 2020 15:56:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7055020734 for ; Mon, 20 Jul 2020 15:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595260619; bh=EEaYoc/pEyzEgkAYaFBflSjPGHg/lWurb1kBnI+GpFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=eBT+SgF7SjjghrNHppMd6lVEnBchLZ+BWyKUmEwfZ/PnnopN98zSwMVdEGGs7WOfk 4vKpoziQSHA4ryBe2SwFGIF0B2H/CPphOy/1i+enLGc5265T81jaQIZLiJd3K7Z/xz NBCb5Wxm1Ba5O6243+yI4oZcf1q1pidgC9fNY2I4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731571AbgGTP46 (ORCPT ); Mon, 20 Jul 2020 11:56:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:56604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731850AbgGTP44 (ORCPT ); Mon, 20 Jul 2020 11:56:56 -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 7A7222065E; Mon, 20 Jul 2020 15:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595260616; bh=EEaYoc/pEyzEgkAYaFBflSjPGHg/lWurb1kBnI+GpFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8rTWwi1ty2K10FlslRcW0KXl2nHQt/boegtH8GD3BGK+IZleLy0bVA+l1FcUsOmI /zqLy0Bp59r86SVH8hFRhu1/eVcqCLKzUQlwXAPc1AXAnB4ajZJloRx/3wOgRk/b8r cztSXajUayEYWYFZ2fSkVAS9Fm4xqLZHC6JBE5QY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Aleksandrov , =?UTF-8?q?Linus=20L=C3=BCssing?= , "David S. Miller" Subject: [PATCH 5.4 005/215] bridge: mcast: Fix MLD2 Report IPv6 payload length check Date: Mon, 20 Jul 2020 17:34:47 +0200 Message-Id: <20200720152820.400624245@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200720152820.122442056@linuxfoundation.org> References: <20200720152820.122442056@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: "Linus Lüssing" [ Upstream commit 5fc6266af7b427243da24f3443a50cd4584aac06 ] Commit e57f61858b7c ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling") introduced a bug in the IPv6 header payload length check which would potentially lead to rejecting a valid MLD2 Report: The check needs to take into account the 2 bytes for the "Number of Sources" field in the "Multicast Address Record" before reading it. And not the size of a pointer to this field. Fixes: e57f61858b7c ("net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling") Acked-by: Nikolay Aleksandrov Signed-off-by: Linus Lüssing Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_multicast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1007,7 +1007,7 @@ static int br_ip6_multicast_mld2_report( nsrcs_offset = len + offsetof(struct mld2_grec, grec_nsrcs); if (skb_transport_offset(skb) + ipv6_transport_len(skb) < - nsrcs_offset + sizeof(_nsrcs)) + nsrcs_offset + sizeof(__nsrcs)) return -EINVAL; _nsrcs = skb_header_pointer(skb, nsrcs_offset,