Skip to content

Commit f67f4f3

Browse files
pcmoorexjamesmorris
authored andcommitted
SELinux: Add a new peer class and permissions to the Flask definitions
Add additional Flask definitions to support the new "peer" object class and additional permissions to the netif, node, and packet object classes. Also, bring the kernel Flask definitions up to date with the Fedora SELinux policies by adding the "flow_in" and "flow_out" permissions to the "packet" class. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: James Morris <jmorris@namei.org>
1 parent 3bb56b2 commit f67f4f3

4 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎security/selinux/include/av_perm_to_string.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
S_(SECCLASS_NODE, NODE__ENFORCE_DEST, "enforce_dest")
3838
S_(SECCLASS_NODE, NODE__DCCP_RECV, "dccp_recv")
3939
S_(SECCLASS_NODE, NODE__DCCP_SEND, "dccp_send")
40+
S_(SECCLASS_NODE, NODE__RECVFROM, "recvfrom")
41+
S_(SECCLASS_NODE, NODE__SENDTO, "sendto")
4042
S_(SECCLASS_NETIF, NETIF__TCP_RECV, "tcp_recv")
4143
S_(SECCLASS_NETIF, NETIF__TCP_SEND, "tcp_send")
4244
S_(SECCLASS_NETIF, NETIF__UDP_RECV, "udp_recv")
@@ -45,6 +47,8 @@
4547
S_(SECCLASS_NETIF, NETIF__RAWIP_SEND, "rawip_send")
4648
S_(SECCLASS_NETIF, NETIF__DCCP_RECV, "dccp_recv")
4749
S_(SECCLASS_NETIF, NETIF__DCCP_SEND, "dccp_send")
50+
S_(SECCLASS_NETIF, NETIF__INGRESS, "ingress")
51+
S_(SECCLASS_NETIF, NETIF__EGRESS, "egress")
4852
S_(SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__CONNECTTO, "connectto")
4953
S_(SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__NEWCONN, "newconn")
5054
S_(SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__ACCEPTFROM, "acceptfrom")
@@ -149,6 +153,10 @@
149153
S_(SECCLASS_PACKET, PACKET__SEND, "send")
150154
S_(SECCLASS_PACKET, PACKET__RECV, "recv")
151155
S_(SECCLASS_PACKET, PACKET__RELABELTO, "relabelto")
156+
S_(SECCLASS_PACKET, PACKET__FLOW_IN, "flow_in")
157+
S_(SECCLASS_PACKET, PACKET__FLOW_OUT, "flow_out")
158+
S_(SECCLASS_PACKET, PACKET__FORWARD_IN, "forward_in")
159+
S_(SECCLASS_PACKET, PACKET__FORWARD_OUT, "forward_out")
152160
S_(SECCLASS_KEY, KEY__VIEW, "view")
153161
S_(SECCLASS_KEY, KEY__READ, "read")
154162
S_(SECCLASS_KEY, KEY__WRITE, "write")
@@ -159,3 +167,4 @@
159167
S_(SECCLASS_DCCP_SOCKET, DCCP_SOCKET__NODE_BIND, "node_bind")
160168
S_(SECCLASS_DCCP_SOCKET, DCCP_SOCKET__NAME_CONNECT, "name_connect")
161169
S_(SECCLASS_MEMPROTECT, MEMPROTECT__MMAP_ZERO, "mmap_zero")
170+
S_(SECCLASS_PEER, PEER__RECV, "recv")

‎security/selinux/include/av_permissions.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@
292292
#define NODE__ENFORCE_DEST 0x00000040UL
293293
#define NODE__DCCP_RECV 0x00000080UL
294294
#define NODE__DCCP_SEND 0x00000100UL
295+
#define NODE__RECVFROM 0x00000200UL
296+
#define NODE__SENDTO 0x00000400UL
295297
#define NETIF__TCP_RECV 0x00000001UL
296298
#define NETIF__TCP_SEND 0x00000002UL
297299
#define NETIF__UDP_RECV 0x00000004UL
@@ -300,6 +302,8 @@
300302
#define NETIF__RAWIP_SEND 0x00000020UL
301303
#define NETIF__DCCP_RECV 0x00000040UL
302304
#define NETIF__DCCP_SEND 0x00000080UL
305+
#define NETIF__INGRESS 0x00000100UL
306+
#define NETIF__EGRESS 0x00000200UL
303307
#define NETLINK_SOCKET__IOCTL 0x00000001UL
304308
#define NETLINK_SOCKET__READ 0x00000002UL
305309
#define NETLINK_SOCKET__WRITE 0x00000004UL
@@ -792,6 +796,10 @@
792796
#define PACKET__SEND 0x00000001UL
793797
#define PACKET__RECV 0x00000002UL
794798
#define PACKET__RELABELTO 0x00000004UL
799+
#define PACKET__FLOW_IN 0x00000008UL
800+
#define PACKET__FLOW_OUT 0x00000010UL
801+
#define PACKET__FORWARD_IN 0x00000020UL
802+
#define PACKET__FORWARD_OUT 0x00000040UL
795803
#define KEY__VIEW 0x00000001UL
796804
#define KEY__READ 0x00000002UL
797805
#define KEY__WRITE 0x00000004UL
@@ -824,3 +832,4 @@
824832
#define DCCP_SOCKET__NODE_BIND 0x00400000UL
825833
#define DCCP_SOCKET__NAME_CONNECT 0x00800000UL
826834
#define MEMPROTECT__MMAP_ZERO 0x00000001UL
835+
#define PEER__RECV 0x00000001UL

‎security/selinux/include/class_to_string.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,10 @@
6464
S_(NULL)
6565
S_("dccp_socket")
6666
S_("memprotect")
67+
S_(NULL)
68+
S_(NULL)
69+
S_(NULL)
70+
S_(NULL)
71+
S_(NULL)
72+
S_(NULL)
73+
S_("peer")

‎security/selinux/include/flask.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define SECCLASS_KEY 58
5151
#define SECCLASS_DCCP_SOCKET 60
5252
#define SECCLASS_MEMPROTECT 61
53+
#define SECCLASS_PEER 68
5354

5455
/*
5556
* Security identifier indices for initial entities

0 commit comments

Comments
 (0)