HomeFreeBSD

if_bridge: fix potential panic

Description

if_bridge: fix potential panic

When a new bridge_rtnode is added it is added with a NULL brt_dst. The
brt_dst is set after the entry is added. This means there's a small
window where another core could also attempt to add this node, leading
to the code attempting to log that the MAC addresses moved to a new
interface.
Aside from that being a spurious log entry it also panics, because
obif is NULL (and we attempt to dereference it).

Avoid this by settings brt_dst before we insert the bridge_rtnode.
Assert that obif is non-NULL, as an extra precaution.

Reported by: olivier@
Reviewed by: zlei@
Differential Revision: https://reviews.freebsd.org/D40147

(cherry picked from commit f3546eacf0daac55fe08b6ad5849b0e440f75ffb)

Details

Provenance
kpAuthored on May 18 2023, 6:04 PM
Differential Revision
D40147: if_bridge: fix potential panic
Parents
rG6edaf8c7aead: pam_krb5: Add missing patch
Branches
Unknown
Tags
Unknown