Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp48680pxb; Tue, 12 Jan 2021 19:40:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTkak9N6ZZLABIwSMOl5d4z2kd03HYZ14h0D61rqRGg249NIXNMxrbcDp6lm2BHyHTJyKr X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr96874ejf.516.1610509240527; Tue, 12 Jan 2021 19:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610509240; cv=none; d=google.com; s=arc-20160816; b=szy60qZm4+TGAvdnRnh4f5Ax5VXskJgaS306wzBZ1PCp2PFBKEW28wTYF6C2QZvAjT JN1tFUd93iYcJfvk9F6bvZI7+rdzpE6qbHNs8RlT17RhfB2GD6CGy3/vi+/I4GGPqCfy 9swABWvxZFYOQHkTIV29E96utVnJQ8NpJOZwjYbkkprb5zs6j6aJTrve944zuGqc0u3H aOEPbCUpcwFPQwWXBpzlXE8sW4EIAAuTkOez5Y7Q6dAA1P+72m3crzbFQ2tveqRtJQWH GHu79xkcwkgB4ujxuDTxnL9ZDSJKeoyJ9I4/CdW/FaC7/WEneBQ3m5FR9Qxbh3ILqVkm rYfg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JAA+4f6cz2QEQJB8Y/lo4SnMIppMwhSfAUeTwWzDBcQ=; b=xxBCskKFZISPCMRhPVKuV0hfthde4+iQ5l5/7KFSJ7gsPkc8M6CERjbjU5ypEYFxtK co8cYjQkP6XDR8zMt133BJGJshVx9ToQQj9v1BjRBiZ2Q/317dTswj6Vseqs0AisW/fs 1SoG2JmMOhPXNCpXr6nuCDiMmI94rn81M0TM/Va6gLeknjZisHHmbMj8SHOZyhs8a0+F TzD3+qxz7omfHQWjJnIwtOj7y2J1OrYR81PJ24gAlkybaB1kBh9U2C1AluWzT2ugYSnX KJ3PSTP8CQA1FISLWlah1brCUHXIGcnjWGugXVNJNOMD+kIWjQbnWtZcKTY6ZaSYxYcs 100g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D0atCIGq; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b21si311030ejv.614.2021.01.12.19.40.17; Tue, 12 Jan 2021 19:40:40 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=D0atCIGq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727942AbhAMCS1 (ORCPT + 99 others); Tue, 12 Jan 2021 21:18:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:37554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727738AbhAMCS0 (ORCPT ); Tue, 12 Jan 2021 21:18:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78514230FC; Wed, 13 Jan 2021 02:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610504265; bh=sFr8FvwKd4eZzn6isvgmzoDL3bFS6hCllpVhEWOPE6Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=D0atCIGqV3jSNztCMFT8dawqx2mCwZ6LEkVWJCkrTADWxFJ3sq5IqbmQJkYqIcdgc DiDZRrCtNpCJ/glFXUnXDkz9a4n3DcDTxl9e6KmaQF74vgQT8ER2OH59FysbqXgHcX 2gwXnlkmtClnHfTupd4vS/cleytlx3HiBDM30NA2FCLeYTUnEYYVNP+kcdeIUTQLVy ZxYUyhv4U7jpLFJC1aR3usI0AABX645KH1Edg0oxaUOq9epY8k2hkMDe6+7/GKypbr 99luJPJtwdvUFHsswEzo6Dinhaa6/CoNH8uksJMsg2dF8nH01tYbpRUfDvf7ncROI3 JhdhfDVflXdIQ== Date: Tue, 12 Jan 2021 18:17:44 -0800 From: Jakub Kicinski To: wangyingjie55@126.com Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] net/ipv4: add IPv4_is_multicast() check in ip_mc_leave_group(). Message-ID: <20210112181744.028dc6bc@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <1610441229-13195-1-git-send-email-wangyingjie55@126.com> References: <1610441229-13195-1-git-send-email-wangyingjie55@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Jan 2021 00:47:09 -0800 wangyingjie55@126.com wrote: > From: Yingjie Wang > > There is no IPv4_is_multicast() check added to ip_mc_leave_group() > to determine whether imr->imr_multiaddr.s_addr is a multicast address. > If not a multicast address, it may result in an error. > In some cases, the callers of ip_mc_leave_group don't check > whether it is multicast address or not such as do_ip_setsockopt(). > So I suggest added the ipv4_is_multicast() check to the > ip_mc_leave_group function to prevent this from happening. > > Fixes: d519aa299494 ("net/ipv4: add IPv4_is_multicast() check in ip_mc_leave_group().") > Signed-off-by: Yingjie Wang Same story with the fixes tag as on your other submission. The fixes tag is supposed to refer to the commit which introduced the bug. It helps the backporters determine whether they need to backport given fix to their trees. In case the commit which added the bug predates git history you can refer to the first commit in the history. HTH