Re: [PATCH v1] net/ipv4: add IPv4_is_multicast() check in ip_mc_leave_group().

From: Jakub Kicinski
Date: Tue Jan 12 2021 - 21:18:28 EST


On Tue, 12 Jan 2021 00:47:09 -0800 wangyingjie55@xxxxxxx wrote:
> From: Yingjie Wang <wangyingjie55@xxxxxxx>
>
> 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 <wangyingjie55@xxxxxxx>

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