HardenedBSD/sys/netlink/route
Konrad Witaszczyk bc06c51419 netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq
The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an
ifaliasreq/in_aliasreq/in6_aliasreq structure object, as their argument.
As opposed to ifaliasreq/in_aliasreq/in6_aliasreq used by
SIOCAIFADDR{,_IN6}, the ifreq/in6_ifreq structures used by the
SIOCDIFADDR{,_IN6} ioctls do not include a separate field for a
broadcast address and other values required to add an address to a
network interface with SIOCAIFADDR{,_IN6}.

Whilst this issue is not specific to CHERI-extended architectures, it
was first observed on CheriBSD running on Arm Morello. For example,
incorrect calls using the in6_aliasreq object result in CHERI capability
violations. A pointer to the ifra_addr field in in6_aliasreq cast to the
ifru_addr union member of in6_ifreq results in bounds being set to the
union's larger size. Such bounds exceed the bounds of of in6_aliasreq
object and the bounds-setting instruction clears a tag of the object's
capability.

Reviewed by:	brooks, kp, oshogbo
Accepted by:	oshogbo (mentor)
Reported by:	CHERI
Obtained from:	CheriBSD
Differential Revision: https://reviews.freebsd.org/D46016
2024-07-22 14:17:21 +00:00
..
common.h
iface_drivers.c netlink: move NETLINK define to opt_global.h 2023-10-13 09:23:47 +02:00
iface.c netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq 2024-07-22 14:17:21 +00:00
ifaddrs.h
interface.h
neigh.c netlink: fix potential llentry lock leak in newneigh handler 2023-10-23 16:24:51 +02:00
neigh.h netlink(4): Fix a typo in a source code comment 2024-01-22 21:52:16 +01:00
nexthop.c netlink: move NETLINK define to opt_global.h 2023-10-13 09:23:47 +02:00
nexthop.h
route_var.h
route.h netlink/route: reformat comment to fit 80 chars 2024-06-20 16:10:39 -07:00
rt.c netlink/route: provide pre-2.6.19 Linux compat shim 2024-06-20 16:10:39 -07:00