]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
lagg: wrap lagg_port2req() into LAGG_SLOCK()
authorGleb Smirnoff <glebius@FreeBSD.org>
Sat, 24 Feb 2024 01:56:46 +0000 (17:56 -0800)
committerGleb Smirnoff <glebius@FreeBSD.org>
Sat, 24 Feb 2024 01:56:46 +0000 (17:56 -0800)
commit48698ead6ff0640098e6aecdd5cbf6ea8f5ac177
treed5c50878fec710b083b20e3154c512ee5bf2ceb1
parent4c6ceca9cc44fc9b02dc39e80713f2ad3ab8eeb6
lagg: wrap lagg_port2req() into LAGG_SLOCK()

Although a port addition is coded in a sequence where first all softc
information is fulfilled and only then it is attached to the lagg, we
still need a locking primitive to guarantee cache invalidation.  Panic
observed in the wild shows that lacp_portreq() called via
lagg_port_ioctl(SIOCGLAGGPORT) immediately after port creation may see
lp->lp_psc as NULL and panic.  In the core file we will see valid data
all around.  A race via lagg_ioctl() wasn't observed but potentially
is possible.

Differential Revision: https://reviews.freebsd.org/D43501
sys/net/if_lagg.c