Commit a6926cc9 authored by James Morris's avatar James Morris

Merge branch 'stable-4.7' of git://git.infradead.org/users/pcmoore/selinux into next

parents 0250abcd c2316dbf
...@@ -677,7 +677,7 @@ int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, ...@@ -677,7 +677,7 @@ int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap,
u32 spot = start; u32 spot = start;
while (rc == 0 && spot <= end) { while (rc == 0 && spot <= end) {
if (((spot & (BITS_PER_LONG - 1)) != 0) && if (((spot & (BITS_PER_LONG - 1)) == 0) &&
((end - spot) > BITS_PER_LONG)) { ((end - spot) > BITS_PER_LONG)) {
rc = netlbl_catmap_setlong(catmap, rc = netlbl_catmap_setlong(catmap,
spot, spot,
......
This diff is collapsed.
...@@ -12,6 +12,18 @@ ...@@ -12,6 +12,18 @@
#define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \ #define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
"write", "associate", "unix_read", "unix_write" "write", "associate", "unix_read", "unix_write"
#define COMMON_CAP_PERMS "chown", "dac_override", "dac_read_search", \
"fowner", "fsetid", "kill", "setgid", "setuid", "setpcap", \
"linux_immutable", "net_bind_service", "net_broadcast", \
"net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module", \
"sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin", \
"sys_boot", "sys_nice", "sys_resource", "sys_time", \
"sys_tty_config", "mknod", "lease", "audit_write", \
"audit_control", "setfcap"
#define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \
"wake_alarm", "block_suspend", "audit_read"
/* /*
* Note: The name for any socket class should be suffixed by "socket", * Note: The name for any socket class should be suffixed by "socket",
* and doesn't contain more than one substr of "socket". * and doesn't contain more than one substr of "socket".
...@@ -32,16 +44,9 @@ struct security_class_mapping secclass_map[] = { ...@@ -32,16 +44,9 @@ struct security_class_mapping secclass_map[] = {
"setsockcreate", NULL } }, "setsockcreate", NULL } },
{ "system", { "system",
{ "ipc_info", "syslog_read", "syslog_mod", { "ipc_info", "syslog_read", "syslog_mod",
"syslog_console", "module_request", NULL } }, "syslog_console", "module_request", "module_load", NULL } },
{ "capability", { "capability",
{ "chown", "dac_override", "dac_read_search", { COMMON_CAP_PERMS, NULL } },
"fowner", "fsetid", "kill", "setgid", "setuid", "setpcap",
"linux_immutable", "net_bind_service", "net_broadcast",
"net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module",
"sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin",
"sys_boot", "sys_nice", "sys_resource", "sys_time",
"sys_tty_config", "mknod", "lease", "audit_write",
"audit_control", "setfcap", NULL } },
{ "filesystem", { "filesystem",
{ "mount", "remount", "unmount", "getattr", { "mount", "remount", "unmount", "getattr",
"relabelfrom", "relabelto", "associate", "quotamod", "relabelfrom", "relabelto", "associate", "quotamod",
...@@ -150,12 +155,15 @@ struct security_class_mapping secclass_map[] = { ...@@ -150,12 +155,15 @@ struct security_class_mapping secclass_map[] = {
{ "memprotect", { "mmap_zero", NULL } }, { "memprotect", { "mmap_zero", NULL } },
{ "peer", { "recv", NULL } }, { "peer", { "recv", NULL } },
{ "capability2", { "capability2",
{ "mac_override", "mac_admin", "syslog", "wake_alarm", "block_suspend", { COMMON_CAP2_PERMS, NULL } },
"audit_read", NULL } },
{ "kernel_service", { "use_as_override", "create_files_as", NULL } }, { "kernel_service", { "use_as_override", "create_files_as", NULL } },
{ "tun_socket", { "tun_socket",
{ COMMON_SOCK_PERMS, "attach_queue", NULL } }, { COMMON_SOCK_PERMS, "attach_queue", NULL } },
{ "binder", { "impersonate", "call", "set_context_mgr", "transfer", { "binder", { "impersonate", "call", "set_context_mgr", "transfer",
NULL } }, NULL } },
{ "cap_userns",
{ COMMON_CAP_PERMS, NULL } },
{ "cap2_userns",
{ COMMON_CAP2_PERMS, NULL } },
{ NULL } { NULL }
}; };
...@@ -17,6 +17,6 @@ int security_get_bools(int *len, char ***names, int **values); ...@@ -17,6 +17,6 @@ int security_get_bools(int *len, char ***names, int **values);
int security_set_bools(int len, int *values); int security_set_bools(int len, int *values);
int security_get_bool_value(int bool); int security_get_bool_value(int index);
#endif #endif
...@@ -38,9 +38,8 @@ struct task_security_struct { ...@@ -38,9 +38,8 @@ struct task_security_struct {
}; };
enum label_initialized { enum label_initialized {
LABEL_MISSING, /* not initialized */ LABEL_INVALID, /* invalid or not initialized */
LABEL_INITIALIZED, /* inizialized */ LABEL_INITIALIZED /* initialized */
LABEL_INVALID /* invalid */
}; };
struct inode_security_struct { struct inode_security_struct {
......
...@@ -2696,7 +2696,7 @@ int security_set_bools(int len, int *values) ...@@ -2696,7 +2696,7 @@ int security_set_bools(int len, int *values)
return rc; return rc;
} }
int security_get_bool_value(int bool) int security_get_bool_value(int index)
{ {
int rc; int rc;
int len; int len;
...@@ -2705,10 +2705,10 @@ int security_get_bool_value(int bool) ...@@ -2705,10 +2705,10 @@ int security_get_bool_value(int bool)
rc = -EFAULT; rc = -EFAULT;
len = policydb.p_bools.nprim; len = policydb.p_bools.nprim;
if (bool >= len) if (index >= len)
goto out; goto out;
rc = policydb.bool_val_to_struct[bool]->state; rc = policydb.bool_val_to_struct[index]->state;
out: out:
read_unlock(&policy_rwlock); read_unlock(&policy_rwlock);
return rc; return rc;
......
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