From 2ebf9d190fd794b22bdb120071520ed77b1c1dcd Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 23 Oct 2019 19:58:33 +0000 Subject: Kernel is missing propper input validation when configuring addresses. Fix the SIOCAIFADDR and SIOCDIFADDR ioctl(2) by implementing in_sa2sin() to validate inet address family and address length. OK visa@ --- sys/netinet/in.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/netinet/in.h') diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 5190efc0206..48111a1c5bc 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in.h,v 1.133 2018/10/13 18:36:01 florian Exp $ */ +/* $OpenBSD: in.h,v 1.134 2019/10/23 19:58:32 bluhm Exp $ */ /* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */ /* @@ -818,6 +818,7 @@ void in_ifdetach(struct ifnet *); int in_mask2len(struct in_addr *); void in_len2mask(struct in_addr *, int); int in_nam2sin(const struct mbuf *, struct sockaddr_in **); +int in_sa2sin(struct sockaddr *, struct sockaddr_in **); char *inet_ntoa(struct in_addr); int inet_nat64(int, const void *, void *, const void *, u_int8_t); -- cgit v1.2.3