Commit 260cac59 authored by Stephen D. Smalley's avatar Stephen D. Smalley Committed by Linus Torvalds

[PATCH] SELinux: regenerate SELinux module headers

This patch regenerates the SELinux module headers to use a new format and
updates their use by the AVC.
Signed-off-by: default avatarStephen Smalley <sds@epoch.ncsc.mil>
Signed-off-by: default avatarJames Morris <jmorris@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0d583489
...@@ -31,13 +31,44 @@ ...@@ -31,13 +31,44 @@
#include <net/ipv6.h> #include <net/ipv6.h>
#include "avc.h" #include "avc.h"
#include "avc_ss.h" #include "avc_ss.h"
static const struct av_perm_to_string
{
u16 tclass;
u32 value;
const char *name;
} av_perm_to_string[] = {
#define S_(c, v, s) { c, v, s },
#include "av_perm_to_string.h"
#undef S_
};
#ifdef CONFIG_AUDIT #ifdef CONFIG_AUDIT
static const char *class_to_string[] = {
#define S_(s) s,
#include "class_to_string.h" #include "class_to_string.h"
#undef S_
};
#endif #endif
#define TB_(s) static const char * s [] = {
#define TE_(s) };
#define S_(s) s,
#include "common_perm_to_string.h" #include "common_perm_to_string.h"
#undef TB_
#undef TE_
#undef S_
static const struct av_inherit
{
u16 tclass;
const char **common_pts;
u32 common_base;
} av_inherit[] = {
#define S_(c, i, b) { c, common_##i##_perm_to_string, b },
#include "av_inherit.h" #include "av_inherit.h"
#include "av_perm_to_string.h" #undef S_
#include "objsec.h" };
#define AVC_CACHE_SLOTS 512 #define AVC_CACHE_SLOTS 512
#define AVC_DEF_CACHE_THRESHOLD 512 #define AVC_DEF_CACHE_THRESHOLD 512
...@@ -110,7 +141,7 @@ static inline int avc_hash(u32 ssid, u32 tsid, u16 tclass) ...@@ -110,7 +141,7 @@ static inline int avc_hash(u32 ssid, u32 tsid, u16 tclass)
*/ */
void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av) void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av)
{ {
char **common_pts = NULL; const char **common_pts = NULL;
u32 common_base = 0; u32 common_base = 0;
int i, i2, perm; int i, i2, perm;
......
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
/* FLASK */ S_(SECCLASS_DIR, file, 0x00020000UL)
S_(SECCLASS_FILE, file, 0x00020000UL)
struct av_inherit S_(SECCLASS_LNK_FILE, file, 0x00020000UL)
{ S_(SECCLASS_CHR_FILE, file, 0x00020000UL)
u16 tclass; S_(SECCLASS_BLK_FILE, file, 0x00020000UL)
char **common_pts; S_(SECCLASS_SOCK_FILE, file, 0x00020000UL)
u32 common_base; S_(SECCLASS_FIFO_FILE, file, 0x00020000UL)
}; S_(SECCLASS_SOCKET, socket, 0x00400000UL)
S_(SECCLASS_TCP_SOCKET, socket, 0x00400000UL)
static struct av_inherit av_inherit[] = { S_(SECCLASS_UDP_SOCKET, socket, 0x00400000UL)
{ SECCLASS_DIR, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_RAWIP_SOCKET, socket, 0x00400000UL)
{ SECCLASS_FILE, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_NETLINK_SOCKET, socket, 0x00400000UL)
{ SECCLASS_LNK_FILE, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_PACKET_SOCKET, socket, 0x00400000UL)
{ SECCLASS_CHR_FILE, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_KEY_SOCKET, socket, 0x00400000UL)
{ SECCLASS_BLK_FILE, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_UNIX_STREAM_SOCKET, socket, 0x00400000UL)
{ SECCLASS_SOCK_FILE, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_UNIX_DGRAM_SOCKET, socket, 0x00400000UL)
{ SECCLASS_FIFO_FILE, common_file_perm_to_string, 0x00020000UL }, S_(SECCLASS_IPC, ipc, 0x00000200UL)
{ SECCLASS_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_SEM, ipc, 0x00000200UL)
{ SECCLASS_TCP_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_MSGQ, ipc, 0x00000200UL)
{ SECCLASS_UDP_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_SHM, ipc, 0x00000200UL)
{ SECCLASS_RAWIP_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_NETLINK_ROUTE_SOCKET, socket, 0x00400000UL)
{ SECCLASS_NETLINK_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_NETLINK_FIREWALL_SOCKET, socket, 0x00400000UL)
{ SECCLASS_PACKET_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_NETLINK_TCPDIAG_SOCKET, socket, 0x00400000UL)
{ SECCLASS_KEY_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_NETLINK_NFLOG_SOCKET, socket, 0x00400000UL)
{ SECCLASS_UNIX_STREAM_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_NETLINK_XFRM_SOCKET, socket, 0x00400000UL)
{ SECCLASS_UNIX_DGRAM_SOCKET, common_socket_perm_to_string, 0x00400000UL }, S_(SECCLASS_NETLINK_SELINUX_SOCKET, socket, 0x00400000UL)
{ SECCLASS_IPC, common_ipc_perm_to_string, 0x00000200UL }, S_(SECCLASS_NETLINK_AUDIT_SOCKET, socket, 0x00400000UL)
{ SECCLASS_SEM, common_ipc_perm_to_string, 0x00000200UL }, S_(SECCLASS_NETLINK_IP6FW_SOCKET, socket, 0x00400000UL)
{ SECCLASS_MSGQ, common_ipc_perm_to_string, 0x00000200UL }, S_(SECCLASS_NETLINK_DNRT_SOCKET, socket, 0x00400000UL)
{ SECCLASS_SHM, common_ipc_perm_to_string, 0x00000200UL },
{ SECCLASS_NETLINK_ROUTE_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_FIREWALL_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_TCPDIAG_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_NFLOG_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_XFRM_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_SELINUX_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_AUDIT_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_IP6FW_SOCKET, common_socket_perm_to_string, 0x00400000UL },
{ SECCLASS_NETLINK_DNRT_SOCKET, common_socket_perm_to_string, 0x00400000UL },
};
/* FLASK */
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
/* FLASK */
#define COMMON_FILE__IOCTL 0x00000001UL #define COMMON_FILE__IOCTL 0x00000001UL
#define COMMON_FILE__READ 0x00000002UL #define COMMON_FILE__READ 0x00000002UL
#define COMMON_FILE__WRITE 0x00000004UL #define COMMON_FILE__WRITE 0x00000004UL
...@@ -556,6 +554,7 @@ ...@@ -556,6 +554,7 @@
#define PASSWD__CHFN 0x00000002UL #define PASSWD__CHFN 0x00000002UL
#define PASSWD__CHSH 0x00000004UL #define PASSWD__CHSH 0x00000004UL
#define PASSWD__ROOTOK 0x00000008UL #define PASSWD__ROOTOK 0x00000008UL
#define PASSWD__CRONTAB 0x00000010UL
#define DRAWABLE__CREATE 0x00000001UL #define DRAWABLE__CREATE 0x00000001UL
#define DRAWABLE__DESTROY 0x00000002UL #define DRAWABLE__DESTROY 0x00000002UL
...@@ -877,5 +876,17 @@ ...@@ -877,5 +876,17 @@
#define NETLINK_DNRT_SOCKET__SENDTO 0x00040000UL #define NETLINK_DNRT_SOCKET__SENDTO 0x00040000UL
#define NETLINK_DNRT_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_DNRT_SOCKET__RECV_MSG 0x00080000UL
#define NETLINK_DNRT_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_DNRT_SOCKET__SEND_MSG 0x00100000UL
#define NETLINK_DNRT_SOCKET__NAME_BIND 0x00200000UL
#define DBUS__ACQUIRE_SVC 0x00000001UL
#define DBUS__SEND_MSG 0x00000002UL
#define NSCD__GETPWD 0x00000001UL
#define NSCD__GETGRP 0x00000002UL
#define NSCD__GETHOST 0x00000004UL
#define NSCD__GETSTAT 0x00000008UL
#define NSCD__ADMIN 0x00000010UL
#define NSCD__SHMEMPWD 0x00000020UL
#define NSCD__SHMEMGRP 0x00000040UL
#define NSCD__SHMEMHOST 0x00000080UL
/* FLASK */
...@@ -2,59 +2,57 @@ ...@@ -2,59 +2,57 @@
/* /*
* Security object class definitions * Security object class definitions
*/ */
static char *class_to_string[] = S_("null")
{ S_("security")
"null", S_("process")
"security", S_("system")
"process", S_("capability")
"system", S_("filesystem")
"capability", S_("file")
"filesystem", S_("dir")
"file", S_("fd")
"dir", S_("lnk_file")
"fd", S_("chr_file")
"lnk_file", S_("blk_file")
"chr_file", S_("sock_file")
"blk_file", S_("fifo_file")
"sock_file", S_("socket")
"fifo_file", S_("tcp_socket")
"socket", S_("udp_socket")
"tcp_socket", S_("rawip_socket")
"udp_socket", S_("node")
"rawip_socket", S_("netif")
"node", S_("netlink_socket")
"netif", S_("packet_socket")
"netlink_socket", S_("key_socket")
"packet_socket", S_("unix_stream_socket")
"key_socket", S_("unix_dgram_socket")
"unix_stream_socket", S_("sem")
"unix_dgram_socket", S_("msg")
"sem", S_("msgq")
"msg", S_("shm")
"msgq", S_("ipc")
"shm", S_("passwd")
"ipc", S_("drawable")
"passwd", S_("window")
"drawable", S_("gc")
"window", S_("font")
"gc", S_("colormap")
"font", S_("property")
"colormap", S_("cursor")
"property", S_("xclient")
"cursor", S_("xinput")
"xclient", S_("xserver")
"xinput", S_("xextension")
"xserver", S_("pax")
"xextension", S_("netlink_route_socket")
"pax", S_("netlink_firewall_socket")
"netlink_route_socket", S_("netlink_tcpdiag_socket")
"netlink_firewall_socket", S_("netlink_nflog_socket")
"netlink_tcpdiag_socket", S_("netlink_xfrm_socket")
"netlink_nflog_socket", S_("netlink_selinux_socket")
"netlink_xfrm_socket", S_("netlink_audit_socket")
"netlink_selinux_socket", S_("netlink_ip6fw_socket")
"netlink_audit_socket", S_("netlink_dnrt_socket")
"netlink_ip6fw_socket", S_("dbus")
"netlink_dnrt_socket", S_("nscd")
};
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
/* FLASK */ TB_(common_file_perm_to_string)
S_("ioctl")
S_("read")
S_("write")
S_("create")
S_("getattr")
S_("setattr")
S_("lock")
S_("relabelfrom")
S_("relabelto")
S_("append")
S_("unlink")
S_("link")
S_("rename")
S_("execute")
S_("swapon")
S_("quotaon")
S_("mounton")
TE_(common_file_perm_to_string)
static char *common_file_perm_to_string[] = TB_(common_socket_perm_to_string)
{ S_("ioctl")
"ioctl", S_("read")
"read", S_("write")
"write", S_("create")
"create", S_("getattr")
"getattr", S_("setattr")
"setattr", S_("lock")
"lock", S_("relabelfrom")
"relabelfrom", S_("relabelto")
"relabelto", S_("append")
"append", S_("bind")
"unlink", S_("connect")
"link", S_("listen")
"rename", S_("accept")
"execute", S_("getopt")
"swapon", S_("setopt")
"quotaon", S_("shutdown")
"mounton", S_("recvfrom")
}; S_("sendto")
S_("recv_msg")
S_("send_msg")
S_("name_bind")
TE_(common_socket_perm_to_string)
static char *common_socket_perm_to_string[] = TB_(common_ipc_perm_to_string)
{ S_("create")
"ioctl", S_("destroy")
"read", S_("getattr")
"write", S_("setattr")
"create", S_("read")
"getattr", S_("write")
"setattr", S_("associate")
"lock", S_("unix_read")
"relabelfrom", S_("unix_write")
"relabelto", TE_(common_ipc_perm_to_string)
"append",
"bind",
"connect",
"listen",
"accept",
"getopt",
"setopt",
"shutdown",
"recvfrom",
"sendto",
"recv_msg",
"send_msg",
"name_bind",
};
static char *common_ipc_perm_to_string[] =
{
"create",
"destroy",
"getattr",
"setattr",
"read",
"write",
"associate",
"unix_read",
"unix_write",
};
/* FLASK */
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#define SECCLASS_NETLINK_AUDIT_SOCKET 49 #define SECCLASS_NETLINK_AUDIT_SOCKET 49
#define SECCLASS_NETLINK_IP6FW_SOCKET 50 #define SECCLASS_NETLINK_IP6FW_SOCKET 50
#define SECCLASS_NETLINK_DNRT_SOCKET 51 #define SECCLASS_NETLINK_DNRT_SOCKET 51
#define SECCLASS_DBUS 52
#define SECCLASS_NSCD 53
/* /*
* Security identifier indices for initial entities * Security identifier indices for initial entities
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment