Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753043AbdFRW2A (ORCPT ); Sun, 18 Jun 2017 18:28:00 -0400 Received: from wp260.webpack.hosteurope.de ([80.237.133.29]:47686 "EHLO wp260.webpack.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbdFRW16 (ORCPT ); Sun, 18 Jun 2017 18:27:58 -0400 X-Greylist: delayed 2522 seconds by postgrey-1.27 at vger.kernel.org; Sun, 18 Jun 2017 18:27:57 EDT From: Luis Ressel To: Paul Moore , Stephen Smalley , Eric Paris , James Morris , "Serge E. Hallyn" , selinux@tycho.nsa.gov (moderated list:SELINUX SECURITY MODULE), linux-security-module@vger.kernel.org (open list:SECURITY SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] selinux: Assign proper class to PF_UNIX/SOCK_RAW sockets Date: Sun, 18 Jun 2017 23:45:32 +0200 Message-Id: <20170618214532.3031-1-aranea@aixah.de> X-Mailer: git-send-email 2.13.1 X-bounce-key: webpack.hosteurope.de;aranea@aixah.de;1497824878;ca8d3827; X-HE-SMSGID: 1dMi11-0004Dm-MK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 628 Lines: 20 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. --- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 819fd6858b49..1a331fba4a3c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1275,6 +1275,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; -- 2.13.1