HardenedBSD/sys/netlink
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
..
route netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq 2024-07-22 14:17:21 +00:00
ktest_netlink_message_writer.c netlink: use protocol specific receive buffer 2024-01-02 13:04:01 -08:00
ktest_netlink_message_writer.h netlink: use protocol specific receive buffer 2024-01-02 13:04:01 -08:00
netlink_bitset.h
netlink_ctl.h
netlink_debug.h netlink: Wrap long lines 2024-07-14 14:29:15 -04:00
netlink_domain.c netlink: fix bug with socket buffer character counter underflow 2024-01-10 20:51:53 -08:00
netlink_generic_kpi.c
netlink_generic.c
netlink_generic.h
netlink_glue.c netlink: Add sysctl descriptions for net.netlink tree 2024-01-08 14:31:31 -05:00
netlink_io.c linux: make linux_netlink_p->msg_from_linux be able to fail 2024-03-29 13:35:51 -07:00
netlink_linux.h linux: make linux_netlink_p->msg_from_linux be able to fail 2024-03-29 13:35:51 -07:00
netlink_message_parser.c netlink: add bool type support 2024-02-28 23:26:18 +01:00
netlink_message_parser.h netlink: add bool type support 2024-02-28 23:26:18 +01:00
netlink_message_writer.c netlink: avoid putting empty mbufs on the socket queue 2024-01-10 20:51:53 -08:00
netlink_message_writer.h pf: convert DIOCGETSTATUS to netlink 2024-04-29 16:32:23 +02:00
netlink_module.c netlink: use protocol specific receive buffer 2024-01-02 13:04:01 -08:00
netlink_route.c
netlink_route.h
netlink_snl_generic.h
netlink_snl_route_compat.h
netlink_snl_route_parsers.h netlink: Fix C++ compile errors 2024-05-24 22:31:42 -06:00
netlink_snl_route.h netlink: Fix C++ compile errors 2024-05-24 22:31:42 -06:00
netlink_snl.h netlink: Fix C++ compile errors 2024-05-24 22:31:42 -06:00
netlink_sysevent.c
netlink_sysevent.h
netlink_var.h netlink: fix regression with group writers 2024-01-09 13:01:28 -08:00
netlink.h netlink.h: s/typeof/__typeof 2024-01-21 18:15:14 -08:00