HomeFreeBSD

infiniband: Widen NET_EPOCH coverage

Description

infiniband: Widen NET_EPOCH coverage

From static code analysis, some device drivers (cxgbe, mlx4, mthca, and qlnx)
do not enter net epoch before lagg_input_infiniband(). If IPoIB interface is a
member of lagg(4) interface, and after returning from lagg_input_infiniband()
the receiving interface of mbuf is set to lagg(4) interface, then when
concurrently destroying the lagg(4) interface, there is a small window that the
interface gets destroyed and becomes invalid before infiniband_input() re-enter
net epoch, thus leading use-after-free.

Widen NET_EPOCH coverage to prevent use-after-free.

Thanks hselasky@ for testing with mlx5 devices.

Reviewed by: hselasky
Tested by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39275

Details

Provenance
zleiAuthored on Apr 2 2023, 4:51 PM
Reviewer
hselasky
Differential Revision
D39275: infiniband: Widen NET_EPOCH coverage
Parents
rG3091d980f581: netlink: add NETLINK to the DEFAULTS for each architecture
Branches
Unknown
Tags
Unknown