Skip to content

Commit 2a764b5

Browse files
atlauapcmoore
authored andcommitted
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 <[email protected]> Acked-by: Stephen Smalley <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 31368ce commit 2a764b5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

security/selinux/hooks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,7 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
13031303
case SOCK_SEQPACKET:
13041304
return SECCLASS_UNIX_STREAM_SOCKET;
13051305
case SOCK_DGRAM:
1306+
case SOCK_RAW:
13061307
return SECCLASS_UNIX_DGRAM_SOCKET;
13071308
}
13081309
break;

0 commit comments

Comments
 (0)