From: Yingjie Wang <redacted>
There is no iPv4_is_multicast() check added to ip_mc_leave_group()
to check if 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 before calling
such as do_ip_setsockopt(). So I suggest adding the ipv4_is_multicast()
check to the ip_mc_leave_group() to prevent this from happening.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yingjie Wang <redacted>
---
net/ipv4/igmp.c | 3 +++
1 file changed, 3 insertions(+)
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-01-19 04:46:03
On Sun, 17 Jan 2021 05:34:16 -0800 wangyingjie55@126.com wrote:
From: Yingjie Wang <redacted>
There is no iPv4_is_multicast() check added to ip_mc_leave_group()
to check if imr->imr_multiaddr.s_addr is a multicast address.
If not a multicast address, it may result in an error.
Could you please say more? From looking at the code it seems like
no address should match if group is non-mcast, and -EADDRNOTAVAIL
will be returned.
Adding Nik to CC.
quoted hunk
In some cases, the callers of ip_mc_leave_group() don't check
whether it is multicast address or not before calling
such as do_ip_setsockopt(). So I suggest adding the ipv4_is_multicast()
check to the ip_mc_leave_group() to prevent this from happening.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yingjie Wang <redacted>
---
net/ipv4/igmp.c | 3 +++
1 file changed, 3 insertions(+)
From: Nikolay Aleksandrov <hidden> Date: 2021-01-19 10:49:47
On 19/01/2021 06:39, Jakub Kicinski wrote:
On Sun, 17 Jan 2021 05:34:16 -0800 wangyingjie55@126.com wrote:
quoted
From: Yingjie Wang <redacted>
There is no iPv4_is_multicast() check added to ip_mc_leave_group()
to check if imr->imr_multiaddr.s_addr is a multicast address.
If not a multicast address, it may result in an error.
Could you please say more? From looking at the code it seems like
no address should match if group is non-mcast, and -EADDRNOTAVAIL
will be returned.
Adding Nik to CC.
Thanks, and absolutely right. I don't see any point in changing the code, also
you are definitely not fixing any bug.
quoted
In some cases, the callers of ip_mc_leave_group() don't check
whether it is multicast address or not before calling
such as do_ip_setsockopt(). So I suggest adding the ipv4_is_multicast()
check to the ip_mc_leave_group() to prevent this from happening.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yingjie Wang <redacted>
---
net/ipv4/igmp.c | 3 +++
1 file changed, 3 insertions(+)