]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: mrp: Fix out-of-bounds read in br_mrp_parse
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 25 May 2020 09:55:41 +0000 (09:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 May 2020 01:09:26 +0000 (18:09 -0700)
commitd1d5c7ea1f4b6e71098ec9ae307a1fdac114e6e9
treef1b8a0e03ddac483345cec7e9588abbfe26c79e4
parentd145854effb40513b36d367c7eea54fbd23ed183
bridge: mrp: Fix out-of-bounds read in br_mrp_parse

The issue was reported by syzbot. When the function br_mrp_parse was
called with a valid net_bridge_port, the net_bridge was an invalid
pointer. Therefore the check br->stp_enabled could pass/fail
depending where it was pointing in memory.
The fix consists of setting the net_bridge pointer if the port is a
valid pointer.

Reported-by: syzbot+9c6f0f1f8e32223df9a4@syzkaller.appspotmail.com
Fixes: c81211ee2e45 ("bridge: mrp: Integrate MRP into the bridge")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_mrp_netlink.c