All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selinux: hooks: Add permission for network MAC address
@ 2014-10-09  0:41 Jeffrey Vander Stoep
  2014-10-09  1:01 ` Joshua Brindle
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jeffrey Vander Stoep @ 2014-10-09  0:41 UTC (permalink / raw)
  To: Selinux

[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]

First time poster to the list. I would appreciate feedback/suggestions
regarding the following patch.

This patch which provides SELinux control over network interface MAC
addresses. This patch allows access to the MAC address to be controlled by
policy. Network MAC addresses are a long lived unique device identifier,
and a security policy may wish to control access to the identifier without
further limiting network use, perhaps for privacy reasons.

The existing SE Linux permissions are too coarse in that they only allow
blanket read/no-read access to this socket ioctl. We would like to consider
both the read/no-read permission as well as an additional permission that
checks the ioctl cmd argument. This allows applications to continue
accessing the IP address, netmask, etc, while being denied access to the
MAC address.

Thanks,
Jeff Vander Stoep

---
 security/selinux/hooks.c            | 7 +++++++
 security/selinux/include/classmap.h | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 1e1266b..cb65fd9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3142,6 +3142,13 @@ static int selinux_file_ioctl(struct file *file,
unsigned int cmd,
     SECURITY_CAP_AUDIT);
  break;

+    case SIOCGIFHWADDR:
+        error = file_has_perm(cred, file, FILE__IOCTL);
+        if (error)
+            break;
+        error = file_has_perm(cred, file, SOCKET__GET_HWADDR);
+        break;
+
  /* default case assumes that the command will go
  * to the file's ioctl() function.
  */
diff --git a/security/selinux/include/classmap.h
b/security/selinux/include/classmap.h
index c32ff7b..306f0d2 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -7,7 +7,7 @@

 #define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \
     "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom",  \
-    "sendto", "recv_msg", "send_msg", "name_bind"
+    "sendto", "recv_msg", "send_msg", "name_bind", "get_hwaddr"

 #define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr",
"read", \
     "write", "associate", "unix_read", "unix_write"
-- 
2.1.0.rc2.206.gedb03e5

[-- Attachment #2: Type: text/html, Size: 3372 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-10-11 21:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09  0:41 [PATCH] selinux: hooks: Add permission for network MAC address Jeffrey Vander Stoep
2014-10-09  1:01 ` Joshua Brindle
2014-10-09  4:09   ` Jeffrey Vander Stoep
2014-10-09 13:54     ` Nick Kralevich
2014-10-09 13:56       ` Joshua Brindle
2014-10-09 14:48 ` Stephen Smalley
2014-10-09 18:48   ` Jeffrey Vander Stoep
2014-10-10 18:22     ` Stephen Smalley
2014-10-11 21:53       ` Paul Moore
2014-10-09 20:20 ` Paul Moore
2014-10-09 21:37   ` Jeffrey Vander Stoep

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.