Re: [PATCH net v3] net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin

From: David Miller
Date: Thu Apr 09 2020 - 13:28:20 EST


From: Vadym Kochan <vadym.kochan@xxxxxxxxxxx>
Date: Thu, 9 Apr 2020 20:25:24 +0300

> From: Taras Chornyi <taras.chornyi@xxxxxxxxxxx>
>
> When CONFIG_IP_MULTICAST is not set and multicast ip is added to the device
> with autojoin flag or when multicast ip is deleted kernel will crash.
>
> steps to reproduce:
>
> ip addr add 224.0.0.0/32 dev eth0
> ip addr del 224.0.0.0/32 dev eth0
>
> or
>
> ip addr add 224.0.0.0/32 dev eth0 autojoin
>
> Unable to handle kernel NULL pointer dereference at virtual address 0000000000000088
> pc : _raw_write_lock_irqsave+0x1e0/0x2ac
> lr : lock_sock_nested+0x1c/0x60
> Call trace:
> _raw_write_lock_irqsave+0x1e0/0x2ac
> lock_sock_nested+0x1c/0x60
> ip_mc_config.isra.28+0x50/0xe0
...
> Fixes: 93a714d6b53d ("multicast: Extend ip address command to enable multicast group join/leave on")
> Signed-off-by: Taras Chornyi <taras.chornyi@xxxxxxxxxxx>
> Signed-off-by: Vadym Kochan <vadym.kochan@xxxxxxxxxxx>

Applied and queued up for -stable, thanks.