From: Chen-Yu Tsai <w...@kernel.org> Date: Sun, 11 Aug 2019 22:18:25 +0800
> From: Chen-Yu Tsai <w...@csie.org> > > The dsa framework has optional .port_mdb_{prepare,add,del} callback fields > for drivers to handle multicast database entries. When adding an entry, the > framework goes through a prepare phase, then a commit phase. Drivers not > providing these callbacks should be detected in the prepare phase. > > DSA core may still bypass the bridge layer and call the dsa_port_mdb_add > function directly with no prepare phase or no switchdev trans object, > and the framework ends up calling an undefined .port_mdb_add callback. > This results in a NULL pointer dereference, as shown in the log below. > > The other functions seem to be properly guarded. Do the same for > .port_mdb_add in dsa_switch_mdb_add_bitmap() as well. ... > Fixes: e6db98db8a95 ("net: dsa: add switch mdb bitmap functions") > Signed-off-by: Chen-Yu Tsai <w...@csie.org> Applied and queued up for -stable, thanks.