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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 9D633C3A59D for ; Mon, 19 Aug 2019 10:13:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BE7E2087B for ; Mon, 19 Aug 2019 10:13:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbfHSKM7 (ORCPT ); Mon, 19 Aug 2019 06:12:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20171 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbfHSKM7 (ORCPT ); Mon, 19 Aug 2019 06:12:59 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 173DD10B78; Mon, 19 Aug 2019 10:12:59 +0000 (UTC) Received: from localhost (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D94C19C58; Mon, 19 Aug 2019 10:12:56 +0000 (UTC) Date: Mon, 19 Aug 2019 12:12:52 +0200 From: Stefano Brivio To: David Miller Cc: gnault@redhat.com, haliu@redhat.com, edumazet@google.com, linus.luessing@c0d3.blue, netdev@vger.kernel.org Subject: Re: [PATCH net] ipv6: Fix return value of ipv6_mc_may_pull() for malformed packets Message-ID: <20190819121252.5fccbef2@redhat.com> In-Reply-To: <20190814.125858.37782529545578263.davem@davemloft.net> References: <20190814.125858.37782529545578263.davem@davemloft.net> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 19 Aug 2019 10:12:59 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, On Wed, 14 Aug 2019 12:58:58 -0400 (EDT) David Miller wrote: > From: Stefano Brivio > Date: Tue, 13 Aug 2019 00:46:01 +0200 > > > Commit ba5ea614622d ("bridge: simplify ip_mc_check_igmp() and > > ipv6_mc_check_mld() calls") replaces direct calls to pskb_may_pull() > > in br_ipv6_multicast_mld2_report() with calls to ipv6_mc_may_pull(), > > that returns -EINVAL on buffers too short to be valid IPv6 packets, > > while maintaining the previous handling of the return code. > > > > This leads to the direct opposite of the intended effect: if the > > packet is malformed, -EINVAL evaluates as true, and we'll happily > > proceed with the processing. > > > > Return 0 if the packet is too short, in the same way as this was > > fixed for IPv4 by commit 083b78a9ed64 ("ip: fix ip_mc_may_pull() > > return value"). > > > > I don't have a reproducer for this, unlike the one referred to by > > the IPv4 commit, but this is clearly broken. > > > > Fixes: ba5ea614622d ("bridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() calls") > > Signed-off-by: Stefano Brivio > > Applied and queued up for -stable. I don't see this on net.git, but it's in your stable bundle on Patchwork. Should I resend? Thanks. -- Stefano