freebsd-dev/sys/netlink/route
Alexander V. Chernikov 04f75b9802 netlink: allow netlink sockets in non-vnet jails.
This change allow to open Netlink sockets in the non-vnet jails, even for
 unpriviledged processes.
The security model largely follows the existing one. To be more specific:
* by default, every `NETLINK_ROUTE` command is **NOT** allowed in non-VNET
 jail UNLESS `RTNL_F_ALLOW_NONVNET_JAIL` flag is specified in the command
 handler.
* All notifications are **disabled** for non-vnet jails (requests to
 subscribe for the notifications are ignored). This will change to be more
 fine-grained model once the first netlink provider requiring this gets
 committed.
* Listing interfaces (RTM_GETLINK) is **allowed** w/o limits (**including**
 interfaces w/o any addresses attached to the jail). The value of this is
 questionable, but it follows the existing approach.
* Listing ARP/NDP neighbours is **forbidden**. This is a **change** from the
 current approach - currently we list static ARP/ND entries belonging to the
 addresses attached to the jail.
* Listing interface addresses is **allowed**, but the addresses are filtered
 to match only ones attached to the jail.
* Listing routes is **allowed**, but the routes are filtered to provide only
 host routes matching the addresses attached to the jail.
* By default, every `NETLINK_GENERIC` command is **allowed** in non-VNET jail
 (as sub-families may be unrelated to network at all).
 It is the goal of the family author to implement the restriction if
 necessary.

Differential Revision: https://reviews.freebsd.org/D39206
MFC after:	1 month
2023-03-26 08:44:09 +00:00
..
common.h netlink: add userland name mappings to all NETLINK_ROUTE messages. 2023-03-01 15:24:45 +00:00
iface_drivers.c netlink: fix vlan interface creation 2023-03-03 16:02:05 +00:00
iface.c netlink: allow netlink sockets in non-vnet jails. 2023-03-26 08:44:09 +00:00
ifaddrs.h netlink: improve RTM_GETADDR handling. 2023-01-08 15:06:34 +00:00
interface.h netlink: improve interface handling 2022-12-14 19:52:35 +00:00
neigh.c netlink: do not require elevated privileges when reading arp/ndp state. 2023-02-09 14:12:33 +00:00
neigh.h
nexthop.c netlink: reduce the default debugging levels 2023-03-21 18:55:00 +00:00
nexthop.h
route_var.h netlink: allow netlink sockets in non-vnet jails. 2023-03-26 08:44:09 +00:00
route.h netlink: allow path weight manipulations for single-path routes. 2023-01-29 16:04:10 +00:00
rt.c netlink: allow netlink sockets in non-vnet jails. 2023-03-26 08:44:09 +00:00