Commit ef37979a authored by Stephen Smalley's avatar Stephen Smalley Committed by Paul Moore

selinux: handle ICMPv6 consistently with ICMP

commit 79c8b348f215 ("selinux: support distinctions among all network
address families") mapped datagram ICMP sockets to the new icmp_socket
security class, but left ICMPv6 sockets unchanged.  This change fixes
that oversight to handle both kinds of sockets consistently.
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent a2c7c6fb
...@@ -1295,7 +1295,8 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc ...@@ -1295,7 +1295,8 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
case SOCK_DGRAM: case SOCK_DGRAM:
if (default_protocol_dgram(protocol)) if (default_protocol_dgram(protocol))
return SECCLASS_UDP_SOCKET; return SECCLASS_UDP_SOCKET;
else if (extsockclass && protocol == IPPROTO_ICMP) else if (extsockclass && (protocol == IPPROTO_ICMP ||
protocol == IPPROTO_ICMPV6))
return SECCLASS_ICMP_SOCKET; return SECCLASS_ICMP_SOCKET;
else else
return SECCLASS_RAWIP_SOCKET; return SECCLASS_RAWIP_SOCKET;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment