]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: multicast: fix igmp/mld port context null pointer dereferences
authorNikolay Aleksandrov <nikolay@nvidia.com>
Wed, 21 Jul 2021 10:06:24 +0000 (13:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Jul 2021 16:04:03 +0000 (09:04 -0700)
commit20268fe651c1e6ba5994459bfbbb17376e8f78f5
tree2ed34b06307271aceb991f25e54e36a17f189973
parentfd23e0ee8d3c8ff1a6a0dc8a005477a6bdda4eb4
net: bridge: multicast: fix igmp/mld port context null pointer dereferences

With the recent change to use bridge/port multicast context pointers
instead of bridge/port I missed to convert two locations which pass the
port pointer as-is, but with the new model we need to verify the port
context is non-NULL first and retrieve the port from it. The first
location is when doing querier selection when a query is received, the
second location is when leaving a group. The port context will be null
if the packets originated from the bridge device (i.e. from the host).
The fix is simple just check if the port context exists and retrieve
the port pointer from it.

Fixes: be5dfb3262c0 ("net: bridge: multicast: use multicast contexts instead of bridge or port")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c