From: Stephen Smalley This patch for SELinux fixes a bug in the mapping of socket types to security classes and ensures that Unix seqpacket sockets are mapped to an appropriate security class. The Unix stream security class is re-used in this case as it has the same permission checking applied as for seqpacket. Signed-off-by: Stephen Smalley Signed-off-by: James Morris Signed-off-by: Andrew Morton --- 25-akpm/security/selinux/hooks.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN security/selinux/hooks.c~map-unix-seqpacket-sockets-to-appropriate security/selinux/hooks.c --- 25/security/selinux/hooks.c~map-unix-seqpacket-sockets-to-appropriate Fri Nov 19 15:25:23 2004 +++ 25-akpm/security/selinux/hooks.c Fri Nov 19 15:25:23 2004 @@ -631,10 +631,12 @@ static inline u16 socket_type_to_securit case PF_UNIX: switch (type) { case SOCK_STREAM: + case SOCK_SEQPACKET: return SECCLASS_UNIX_STREAM_SOCKET; case SOCK_DGRAM: return SECCLASS_UNIX_DGRAM_SOCKET; } + break; case PF_INET: case PF_INET6: switch (type) { @@ -645,6 +647,7 @@ static inline u16 socket_type_to_securit case SOCK_RAW: return SECCLASS_RAWIP_SOCKET; } + break; case PF_NETLINK: switch (protocol) { case NETLINK_ROUTE: _