mirror of
https://github.com/opnsense/src.git
synced 2026-04-03 16:35:27 -04:00
The routing stack control depends on quite a tree of functions to determine the proper attributes of a route such as a source address (ifa) or transmit ifp of a route. When actually inserting a route, the stack needs to ensure that ifa and ifp points to the entities that are still valid. Validity means slightly more than just pointer validity - stack need guarantee that the provided objects are not scheduled for deletion. Currently, callers either ignore it (most ifp parts, historically) or try to use refcounting (ifa parts). Even in case of ifa refcounting it's not always implemented in fully-safe manner. For example, some codepaths inside rt_getifa_fib() are referencing ifa while not holding any locks, resulting in possibility of referencing scheduled-for-deletion ifa. Instead of trying to fix all of the callers by enforcing proper refcounting, switch to a different model. As the rib_action() already requires epoch, do not require any stability guarantees other than the epoch-provided one. Use newly-added conditional versions of the refcounting functions (ifa_try_ref(), if_try_ref()) and fail if any of these fails. Reviewed by: donner MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28837 |
||
|---|---|---|
| .. | ||
| fib_algo.c | ||
| fib_algo.h | ||
| mpath_ctl.c | ||
| nhgrp.c | ||
| nhgrp_ctl.c | ||
| nhgrp_var.h | ||
| nhop.c | ||
| nhop.h | ||
| nhop_ctl.c | ||
| nhop_utils.c | ||
| nhop_utils.h | ||
| nhop_var.h | ||
| route_ctl.c | ||
| route_ctl.h | ||
| route_ddb.c | ||
| route_helpers.c | ||
| route_ifaddrs.c | ||
| route_tables.c | ||
| route_temporal.c | ||
| route_var.h | ||