From: Luis Ressel Date: Tue, 25 Jul 2017 19:13:41 +0000 (-0400) Subject: selinux: Assign proper class to PF_UNIX/SOCK_RAW sockets X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a764b529ae57bed61da2c90ff132b9fec97f80b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git selinux: Assign proper class to PF_UNIX/SOCK_RAW sockets For PF_UNIX, SOCK_RAW is synonymous with SOCK_DGRAM (cf. net/unix/af_unix.c). This is a tad obscure, but libpcap uses it. Signed-off-by: Luis Ressel Acked-by: Stephen Smalley Signed-off-by: Paul Moore --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 33fd061305c4..00ad46e166f6 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1303,6 +1303,7 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc case SOCK_SEQPACKET: return SECCLASS_UNIX_STREAM_SOCKET; case SOCK_DGRAM: + case SOCK_RAW: return SECCLASS_UNIX_DGRAM_SOCKET; } break;