]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
capsicum: Limit socket operations in capability mode
authorMark Johnston <markj@FreeBSD.org>
Wed, 7 Apr 2021 18:19:52 +0000 (14:19 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 7 Apr 2021 18:32:56 +0000 (14:32 -0400)
commit274579831b61fccd5ce849350430e5167d0024f0
tree986182c25bc807473ad08d8d1a19d9f4385989a9
parent12db51d20823a5e3b9e5f8a2ea73156fe1cbfc28
capsicum: Limit socket operations in capability mode

Capsicum did not prevent certain privileged networking operations,
specifically creation of raw sockets and network configuration ioctls.
However, these facilities can be used to circumvent some of the
restrictions that capability mode is supposed to enforce.

Add capability mode checks to disallow network configuration ioctls and
creation of sockets other than PF_LOCAL and SOCK_DGRAM/STREAM/SEQPACKET
internet sockets.

Reviewed by: oshogbo
Discussed with: emaste
Reported by: manu
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29423
sys/kern/sys_socket.c
sys/kern/uipc_socket.c
sys/kern/uipc_usrreq.c
sys/net/if.c
sys/net/route.c
sys/net/route.h
sys/netinet/in.c
sys/netinet/in_proto.c
sys/netinet6/in6.c
sys/netinet6/in6_proto.c
sys/sys/protosw.h