aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-12 16:21:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-12 16:21:00 -0400
commit7f85565a3f7194b966de71926471d69788b6b9c3 (patch)
tree95f93ab1d18dc1121cd5ec71309c7e6cb4dedc7b /security/selinux
parent680352bda57e3dbf21cddf6a5e23aff7e294fb31 (diff)
parent0c3014f22dec0e1d14c8298551bfb6434638bdd9 (diff)
Merge tag 'selinux-pr-20170831' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux updates from Paul Moore: "A relatively quiet period for SELinux, 11 patches with only two/three having any substantive changes. These noteworthy changes include another tweak to the NNP/nosuid handling, per-file labeling for cgroups, and an object class fix for AF_UNIX/SOCK_RAW sockets; the rest of the changes are minor tweaks or administrative updates (Stephen's email update explains the file explosion in the diffstat). Everything passes the selinux-testsuite" [ Also a couple of small patches from the security tree from Tetsuo Handa for Tomoyo and LSM cleanup. The separation of security policy updates wasn't all that clean - Linus ] * tag 'selinux-pr-20170831' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: constify nf_hook_ops selinux: allow per-file labeling for cgroupfs lsm_audit: update my email address selinux: update my email address MAINTAINERS: update the NetLabel and Labeled Networking information selinux: use GFP_NOWAIT in the AVC kmem_caches selinux: Generalize support for NNP/nosuid SELinux domain transitions selinux: genheaders should fail if too many permissions are defined selinux: update the selinux info in MAINTAINERS credits: update Paul Moore's info selinux: Assign proper class to PF_UNIX/SOCK_RAW sockets tomoyo: Update URLs in Documentation/admin-guide/LSM/tomoyo.rst LSM: Remove security_task_create() hook.
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/avc.c16
-rw-r--r--security/selinux/hooks.c54
-rw-r--r--security/selinux/include/avc.h2
-rw-r--r--security/selinux/include/avc_ss.h2
-rw-r--r--security/selinux/include/classmap.h2
-rw-r--r--security/selinux/include/objsec.h2
-rw-r--r--security/selinux/include/security.h4
-rw-r--r--security/selinux/ss/avtab.c2
-rw-r--r--security/selinux/ss/avtab.h2
-rw-r--r--security/selinux/ss/constraint.h2
-rw-r--r--security/selinux/ss/context.h2
-rw-r--r--security/selinux/ss/ebitmap.c2
-rw-r--r--security/selinux/ss/ebitmap.h2
-rw-r--r--security/selinux/ss/hashtab.c2
-rw-r--r--security/selinux/ss/hashtab.h2
-rw-r--r--security/selinux/ss/mls.c2
-rw-r--r--security/selinux/ss/mls.h2
-rw-r--r--security/selinux/ss/mls_types.h2
-rw-r--r--security/selinux/ss/policydb.c2
-rw-r--r--security/selinux/ss/policydb.h2
-rw-r--r--security/selinux/ss/services.c9
-rw-r--r--security/selinux/ss/services.h2
-rw-r--r--security/selinux/ss/sidtab.c2
-rw-r--r--security/selinux/ss/sidtab.h2
-rw-r--r--security/selinux/ss/symtab.c2
-rw-r--r--security/selinux/ss/symtab.h2
26 files changed, 77 insertions, 50 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 4b4293194aee..2380b8d72cec 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the kernel access vector cache (AVC). 2 * Implementation of the kernel access vector cache (AVC).
3 * 3 *
4 * Authors: Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Authors: Stephen Smalley, <sds@tycho.nsa.gov>
5 * James Morris <jmorris@redhat.com> 5 * James Morris <jmorris@redhat.com>
6 * 6 *
7 * Update: KaiGai, Kohei <kaigai@ak.jp.nec.com> 7 * Update: KaiGai, Kohei <kaigai@ak.jp.nec.com>
@@ -346,27 +346,26 @@ static struct avc_xperms_decision_node
346 struct avc_xperms_decision_node *xpd_node; 346 struct avc_xperms_decision_node *xpd_node;
347 struct extended_perms_decision *xpd; 347 struct extended_perms_decision *xpd;
348 348
349 xpd_node = kmem_cache_zalloc(avc_xperms_decision_cachep, 349 xpd_node = kmem_cache_zalloc(avc_xperms_decision_cachep, GFP_NOWAIT);
350 GFP_ATOMIC | __GFP_NOMEMALLOC);
351 if (!xpd_node) 350 if (!xpd_node)
352 return NULL; 351 return NULL;
353 352
354 xpd = &xpd_node->xpd; 353 xpd = &xpd_node->xpd;
355 if (which & XPERMS_ALLOWED) { 354 if (which & XPERMS_ALLOWED) {
356 xpd->allowed = kmem_cache_zalloc(avc_xperms_data_cachep, 355 xpd->allowed = kmem_cache_zalloc(avc_xperms_data_cachep,
357 GFP_ATOMIC | __GFP_NOMEMALLOC); 356 GFP_NOWAIT);
358 if (!xpd->allowed) 357 if (!xpd->allowed)
359 goto error; 358 goto error;
360 } 359 }
361 if (which & XPERMS_AUDITALLOW) { 360 if (which & XPERMS_AUDITALLOW) {
362 xpd->auditallow = kmem_cache_zalloc(avc_xperms_data_cachep, 361 xpd->auditallow = kmem_cache_zalloc(avc_xperms_data_cachep,
363 GFP_ATOMIC | __GFP_NOMEMALLOC); 362 GFP_NOWAIT);
364 if (!xpd->auditallow) 363 if (!xpd->auditallow)
365 goto error; 364 goto error;
366 } 365 }
367 if (which & XPERMS_DONTAUDIT) { 366 if (which & XPERMS_DONTAUDIT) {
368 xpd->dontaudit = kmem_cache_zalloc(avc_xperms_data_cachep, 367 xpd->dontaudit = kmem_cache_zalloc(avc_xperms_data_cachep,
369 GFP_ATOMIC | __GFP_NOMEMALLOC); 368 GFP_NOWAIT);
370 if (!xpd->dontaudit) 369 if (!xpd->dontaudit)
371 goto error; 370 goto error;
372 } 371 }
@@ -394,8 +393,7 @@ static struct avc_xperms_node *avc_xperms_alloc(void)
394{ 393{
395 struct avc_xperms_node *xp_node; 394 struct avc_xperms_node *xp_node;
396 395
397 xp_node = kmem_cache_zalloc(avc_xperms_cachep, 396 xp_node = kmem_cache_zalloc(avc_xperms_cachep, GFP_NOWAIT);
398 GFP_ATOMIC|__GFP_NOMEMALLOC);
399 if (!xp_node) 397 if (!xp_node)
400 return xp_node; 398 return xp_node;
401 INIT_LIST_HEAD(&xp_node->xpd_head); 399 INIT_LIST_HEAD(&xp_node->xpd_head);
@@ -548,7 +546,7 @@ static struct avc_node *avc_alloc_node(void)
548{ 546{
549 struct avc_node *node; 547 struct avc_node *node;
550 548
551 node = kmem_cache_zalloc(avc_node_cachep, GFP_ATOMIC|__GFP_NOMEMALLOC); 549 node = kmem_cache_zalloc(avc_node_cachep, GFP_NOWAIT);
552 if (!node) 550 if (!node)
553 goto out; 551 goto out;
554 552
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ad3b0f53ede0..f5d304736852 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * This file contains the SELinux hook function implementations. 4 * This file contains the SELinux hook function implementations.
5 * 5 *
6 * Authors: Stephen Smalley, <sds@epoch.ncsc.mil> 6 * Authors: Stephen Smalley, <sds@tycho.nsa.gov>
7 * Chris Vance, <cvance@nai.com> 7 * Chris Vance, <cvance@nai.com>
8 * Wayne Salamon, <wsalamon@nai.com> 8 * Wayne Salamon, <wsalamon@nai.com>
9 * James Morris <jmorris@redhat.com> 9 * James Morris <jmorris@redhat.com>
@@ -815,7 +815,9 @@ static int selinux_set_mnt_opts(struct super_block *sb,
815 if (!strcmp(sb->s_type->name, "debugfs") || 815 if (!strcmp(sb->s_type->name, "debugfs") ||
816 !strcmp(sb->s_type->name, "tracefs") || 816 !strcmp(sb->s_type->name, "tracefs") ||
817 !strcmp(sb->s_type->name, "sysfs") || 817 !strcmp(sb->s_type->name, "sysfs") ||
818 !strcmp(sb->s_type->name, "pstore")) 818 !strcmp(sb->s_type->name, "pstore") ||
819 !strcmp(sb->s_type->name, "cgroup") ||
820 !strcmp(sb->s_type->name, "cgroup2"))
819 sbsec->flags |= SE_SBGENFS; 821 sbsec->flags |= SE_SBGENFS;
820 822
821 if (!sbsec->behavior) { 823 if (!sbsec->behavior) {
@@ -1303,6 +1305,7 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
1303 case SOCK_SEQPACKET: 1305 case SOCK_SEQPACKET:
1304 return SECCLASS_UNIX_STREAM_SOCKET; 1306 return SECCLASS_UNIX_STREAM_SOCKET;
1305 case SOCK_DGRAM: 1307 case SOCK_DGRAM:
1308 case SOCK_RAW:
1306 return SECCLASS_UNIX_DGRAM_SOCKET; 1309 return SECCLASS_UNIX_DGRAM_SOCKET;
1307 } 1310 }
1308 break; 1311 break;
@@ -2317,6 +2320,7 @@ static int check_nnp_nosuid(const struct linux_binprm *bprm,
2317 int nnp = (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS); 2320 int nnp = (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS);
2318 int nosuid = !mnt_may_suid(bprm->file->f_path.mnt); 2321 int nosuid = !mnt_may_suid(bprm->file->f_path.mnt);
2319 int rc; 2322 int rc;
2323 u32 av;
2320 2324
2321 if (!nnp && !nosuid) 2325 if (!nnp && !nosuid)
2322 return 0; /* neither NNP nor nosuid */ 2326 return 0; /* neither NNP nor nosuid */
@@ -2325,24 +2329,40 @@ static int check_nnp_nosuid(const struct linux_binprm *bprm,
2325 return 0; /* No change in credentials */ 2329 return 0; /* No change in credentials */
2326 2330
2327 /* 2331 /*
2328 * The only transitions we permit under NNP or nosuid 2332 * If the policy enables the nnp_nosuid_transition policy capability,
2329 * are transitions to bounded SIDs, i.e. SIDs that are 2333 * then we permit transitions under NNP or nosuid if the
2330 * guaranteed to only be allowed a subset of the permissions 2334 * policy allows the corresponding permission between
2331 * of the current SID. 2335 * the old and new contexts.
2332 */ 2336 */
2333 rc = security_bounded_transition(old_tsec->sid, new_tsec->sid); 2337 if (selinux_policycap_nnp_nosuid_transition) {
2334 if (rc) { 2338 av = 0;
2335 /*
2336 * On failure, preserve the errno values for NNP vs nosuid.
2337 * NNP: Operation not permitted for caller.
2338 * nosuid: Permission denied to file.
2339 */
2340 if (nnp) 2339 if (nnp)
2341 return -EPERM; 2340 av |= PROCESS2__NNP_TRANSITION;
2342 else 2341 if (nosuid)
2343 return -EACCES; 2342 av |= PROCESS2__NOSUID_TRANSITION;
2343 rc = avc_has_perm(old_tsec->sid, new_tsec->sid,
2344 SECCLASS_PROCESS2, av, NULL);
2345 if (!rc)
2346 return 0;
2344 } 2347 }
2345 return 0; 2348
2349 /*
2350 * We also permit NNP or nosuid transitions to bounded SIDs,
2351 * i.e. SIDs that are guaranteed to only be allowed a subset
2352 * of the permissions of the current SID.
2353 */
2354 rc = security_bounded_transition(old_tsec->sid, new_tsec->sid);
2355 if (!rc)
2356 return 0;
2357
2358 /*
2359 * On failure, preserve the errno values for NNP vs nosuid.
2360 * NNP: Operation not permitted for caller.
2361 * nosuid: Permission denied to file.
2362 */
2363 if (nnp)
2364 return -EPERM;
2365 return -EACCES;
2346} 2366}
2347 2367
2348static int selinux_bprm_set_creds(struct linux_binprm *bprm) 2368static int selinux_bprm_set_creds(struct linux_binprm *bprm)
diff --git a/security/selinux/include/avc.h b/security/selinux/include/avc.h
index 0999df03af8b..a5004e9de11a 100644
--- a/security/selinux/include/avc.h
+++ b/security/selinux/include/avc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Access vector cache interface for object managers. 2 * Access vector cache interface for object managers.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6#ifndef _SELINUX_AVC_H_ 6#ifndef _SELINUX_AVC_H_
7#define _SELINUX_AVC_H_ 7#define _SELINUX_AVC_H_
diff --git a/security/selinux/include/avc_ss.h b/security/selinux/include/avc_ss.h
index d5c328452df0..37d57dadd476 100644
--- a/security/selinux/include/avc_ss.h
+++ b/security/selinux/include/avc_ss.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Access vector cache interface for the security server. 2 * Access vector cache interface for the security server.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6#ifndef _SELINUX_AVC_SS_H_ 6#ifndef _SELINUX_AVC_SS_H_
7#define _SELINUX_AVC_SS_H_ 7#define _SELINUX_AVC_SS_H_
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
index b9fe3434b036..35ffb29a69cb 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -48,6 +48,8 @@ struct security_class_mapping secclass_map[] = {
48 "setrlimit", "rlimitinh", "dyntransition", "setcurrent", 48 "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
49 "execmem", "execstack", "execheap", "setkeycreate", 49 "execmem", "execstack", "execheap", "setkeycreate",
50 "setsockcreate", "getrlimit", NULL } }, 50 "setsockcreate", "getrlimit", NULL } },
51 { "process2",
52 { "nnp_transition", "nosuid_transition", NULL } },
51 { "system", 53 { "system",
52 { "ipc_info", "syslog_read", "syslog_mod", 54 { "ipc_info", "syslog_read", "syslog_mod",
53 "syslog_console", "module_request", "module_load", NULL } }, 55 "syslog_console", "module_request", "module_load", NULL } },
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index 6ebc61e370ff..1649cd18eb0b 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * This file contains the SELinux security data structures for kernel objects. 4 * This file contains the SELinux security data structures for kernel objects.
5 * 5 *
6 * Author(s): Stephen Smalley, <sds@epoch.ncsc.mil> 6 * Author(s): Stephen Smalley, <sds@tycho.nsa.gov>
7 * Chris Vance, <cvance@nai.com> 7 * Chris Vance, <cvance@nai.com>
8 * Wayne Salamon, <wsalamon@nai.com> 8 * Wayne Salamon, <wsalamon@nai.com>
9 * James Morris <jmorris@redhat.com> 9 * James Morris <jmorris@redhat.com>
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index e91f08c16c0b..28dfb2f93e4d 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Security server interface. 2 * Security server interface.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 * 5 *
6 */ 6 */
7 7
@@ -73,6 +73,7 @@ enum {
73 POLICYDB_CAPABILITY_EXTSOCKCLASS, 73 POLICYDB_CAPABILITY_EXTSOCKCLASS,
74 POLICYDB_CAPABILITY_ALWAYSNETWORK, 74 POLICYDB_CAPABILITY_ALWAYSNETWORK,
75 POLICYDB_CAPABILITY_CGROUPSECLABEL, 75 POLICYDB_CAPABILITY_CGROUPSECLABEL,
76 POLICYDB_CAPABILITY_NNP_NOSUID_TRANSITION,
76 __POLICYDB_CAPABILITY_MAX 77 __POLICYDB_CAPABILITY_MAX
77}; 78};
78#define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1) 79#define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1)
@@ -84,6 +85,7 @@ extern int selinux_policycap_openperm;
84extern int selinux_policycap_extsockclass; 85extern int selinux_policycap_extsockclass;
85extern int selinux_policycap_alwaysnetwork; 86extern int selinux_policycap_alwaysnetwork;
86extern int selinux_policycap_cgroupseclabel; 87extern int selinux_policycap_cgroupseclabel;
88extern int selinux_policycap_nnp_nosuid_transition;
87 89
88/* 90/*
89 * type_datum properties 91 * type_datum properties
diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c
index 3628d3a868b6..2c3c7d010d8a 100644
--- a/security/selinux/ss/avtab.c
+++ b/security/selinux/ss/avtab.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the access vector table type. 2 * Implementation of the access vector table type.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6 6
7/* Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com> 7/* Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com>
diff --git a/security/selinux/ss/avtab.h b/security/selinux/ss/avtab.h
index d946c9dc3c9c..725853cadc42 100644
--- a/security/selinux/ss/avtab.h
+++ b/security/selinux/ss/avtab.h
@@ -5,7 +5,7 @@
5 * table is used to represent the type enforcement 5 * table is used to represent the type enforcement
6 * tables. 6 * tables.
7 * 7 *
8 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 8 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
9 */ 9 */
10 10
11/* Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com> 11/* Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com>
diff --git a/security/selinux/ss/constraint.h b/security/selinux/ss/constraint.h
index 96fd947c494b..33ae2aec4f36 100644
--- a/security/selinux/ss/constraint.h
+++ b/security/selinux/ss/constraint.h
@@ -10,7 +10,7 @@
10 * process from labeling an object with a different user 10 * process from labeling an object with a different user
11 * identity. 11 * identity.
12 * 12 *
13 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 13 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
14 */ 14 */
15#ifndef _SS_CONSTRAINT_H_ 15#ifndef _SS_CONSTRAINT_H_
16#define _SS_CONSTRAINT_H_ 16#define _SS_CONSTRAINT_H_
diff --git a/security/selinux/ss/context.h b/security/selinux/ss/context.h
index 212e3479a0d9..a2c0f37c42ae 100644
--- a/security/selinux/ss/context.h
+++ b/security/selinux/ss/context.h
@@ -10,7 +10,7 @@
10 * security server and can be changed without affecting 10 * security server and can be changed without affecting
11 * clients of the security server. 11 * clients of the security server.
12 * 12 *
13 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 13 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
14 */ 14 */
15#ifndef _SS_CONTEXT_H_ 15#ifndef _SS_CONTEXT_H_
16#define _SS_CONTEXT_H_ 16#define _SS_CONTEXT_H_
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c
index ad38299164c3..fc28149a4f2e 100644
--- a/security/selinux/ss/ebitmap.c
+++ b/security/selinux/ss/ebitmap.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the extensible bitmap type. 2 * Implementation of the extensible bitmap type.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6/* 6/*
7 * Updated: Hewlett-Packard <paul@paul-moore.com> 7 * Updated: Hewlett-Packard <paul@paul-moore.com>
diff --git a/security/selinux/ss/ebitmap.h b/security/selinux/ss/ebitmap.h
index 6d5a9ac4251f..da1325dda550 100644
--- a/security/selinux/ss/ebitmap.h
+++ b/security/selinux/ss/ebitmap.h
@@ -9,7 +9,7 @@
9 * an explicitly specified starting bit position within 9 * an explicitly specified starting bit position within
10 * the total bitmap. 10 * the total bitmap.
11 * 11 *
12 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 12 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
13 */ 13 */
14#ifndef _SS_EBITMAP_H_ 14#ifndef _SS_EBITMAP_H_
15#define _SS_EBITMAP_H_ 15#define _SS_EBITMAP_H_
diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c
index 3858706a29fb..686c3917064c 100644
--- a/security/selinux/ss/hashtab.c
+++ b/security/selinux/ss/hashtab.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the hash table type. 2 * Implementation of the hash table type.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/slab.h> 7#include <linux/slab.h>
diff --git a/security/selinux/ss/hashtab.h b/security/selinux/ss/hashtab.h
index 953872cd84ab..009fb5e06172 100644
--- a/security/selinux/ss/hashtab.h
+++ b/security/selinux/ss/hashtab.h
@@ -5,7 +5,7 @@
5 * functions for hash computation and key comparison are 5 * functions for hash computation and key comparison are
6 * provided by the creator of the table. 6 * provided by the creator of the table.
7 * 7 *
8 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 8 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
9 */ 9 */
10#ifndef _SS_HASHTAB_H_ 10#ifndef _SS_HASHTAB_H_
11#define _SS_HASHTAB_H_ 11#define _SS_HASHTAB_H_
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index e1088842232c..d9dc34f4fade 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the multi-level security (MLS) policy. 2 * Implementation of the multi-level security (MLS) policy.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6/* 6/*
7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> 7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h
index e4369e3e6366..0f0a1d65b2ce 100644
--- a/security/selinux/ss/mls.h
+++ b/security/selinux/ss/mls.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Multi-level security (MLS) policy operations. 2 * Multi-level security (MLS) policy operations.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6/* 6/*
7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> 7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
diff --git a/security/selinux/ss/mls_types.h b/security/selinux/ss/mls_types.h
index e93648774137..47f3702cd596 100644
--- a/security/selinux/ss/mls_types.h
+++ b/security/selinux/ss/mls_types.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Type definitions for the multi-level security (MLS) policy. 2 * Type definitions for the multi-level security (MLS) policy.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6/* 6/*
7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> 7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index aa6500abb178..6e8c8056d7ad 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the policy database. 2 * Implementation of the policy database.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6 6
7/* 7/*
diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h
index 5d23eed35fa7..215f8f30ac5a 100644
--- a/security/selinux/ss/policydb.h
+++ b/security/selinux/ss/policydb.h
@@ -2,7 +2,7 @@
2 * A policy database (policydb) specifies the 2 * A policy database (policydb) specifies the
3 * configuration data for the security policy. 3 * configuration data for the security policy.
4 * 4 *
5 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 5 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
6 */ 6 */
7 7
8/* 8/*
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 2f02fa67ec2e..e4a1c0dc561a 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the security services. 2 * Implementation of the security services.
3 * 3 *
4 * Authors : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Authors : Stephen Smalley, <sds@tycho.nsa.gov>
5 * James Morris <jmorris@redhat.com> 5 * James Morris <jmorris@redhat.com>
6 * 6 *
7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> 7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
@@ -76,7 +76,8 @@ char *selinux_policycap_names[__POLICYDB_CAPABILITY_MAX] = {
76 "open_perms", 76 "open_perms",
77 "extended_socket_class", 77 "extended_socket_class",
78 "always_check_network", 78 "always_check_network",
79 "cgroup_seclabel" 79 "cgroup_seclabel",
80 "nnp_nosuid_transition"
80}; 81};
81 82
82int selinux_policycap_netpeer; 83int selinux_policycap_netpeer;
@@ -84,6 +85,7 @@ int selinux_policycap_openperm;
84int selinux_policycap_extsockclass; 85int selinux_policycap_extsockclass;
85int selinux_policycap_alwaysnetwork; 86int selinux_policycap_alwaysnetwork;
86int selinux_policycap_cgroupseclabel; 87int selinux_policycap_cgroupseclabel;
88int selinux_policycap_nnp_nosuid_transition;
87 89
88static DEFINE_RWLOCK(policy_rwlock); 90static DEFINE_RWLOCK(policy_rwlock);
89 91
@@ -2009,6 +2011,9 @@ static void security_load_policycaps(void)
2009 selinux_policycap_cgroupseclabel = 2011 selinux_policycap_cgroupseclabel =
2010 ebitmap_get_bit(&policydb.policycaps, 2012 ebitmap_get_bit(&policydb.policycaps,
2011 POLICYDB_CAPABILITY_CGROUPSECLABEL); 2013 POLICYDB_CAPABILITY_CGROUPSECLABEL);
2014 selinux_policycap_nnp_nosuid_transition =
2015 ebitmap_get_bit(&policydb.policycaps,
2016 POLICYDB_CAPABILITY_NNP_NOSUID_TRANSITION);
2012 2017
2013 for (i = 0; i < ARRAY_SIZE(selinux_policycap_names); i++) 2018 for (i = 0; i < ARRAY_SIZE(selinux_policycap_names); i++)
2014 pr_info("SELinux: policy capability %s=%d\n", 2019 pr_info("SELinux: policy capability %s=%d\n",
diff --git a/security/selinux/ss/services.h b/security/selinux/ss/services.h
index 6abcd8729ec3..3d9fa9556b4f 100644
--- a/security/selinux/ss/services.h
+++ b/security/selinux/ss/services.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the security services. 2 * Implementation of the security services.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6#ifndef _SS_SERVICES_H_ 6#ifndef _SS_SERVICES_H_
7#define _SS_SERVICES_H_ 7#define _SS_SERVICES_H_
diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c
index c5f436b15d19..6ae08efc5ae7 100644
--- a/security/selinux/ss/sidtab.c
+++ b/security/selinux/ss/sidtab.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the SID table type. 2 * Implementation of the SID table type.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/slab.h> 7#include <linux/slab.h>
diff --git a/security/selinux/ss/sidtab.h b/security/selinux/ss/sidtab.h
index 84dc154d9389..de5d0ea583d2 100644
--- a/security/selinux/ss/sidtab.h
+++ b/security/selinux/ss/sidtab.h
@@ -2,7 +2,7 @@
2 * A security identifier table (sidtab) is a hash table 2 * A security identifier table (sidtab) is a hash table
3 * of security context structures indexed by SID value. 3 * of security context structures indexed by SID value.
4 * 4 *
5 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 5 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
6 */ 6 */
7#ifndef _SS_SIDTAB_H_ 7#ifndef _SS_SIDTAB_H_
8#define _SS_SIDTAB_H_ 8#define _SS_SIDTAB_H_
diff --git a/security/selinux/ss/symtab.c b/security/selinux/ss/symtab.c
index 160326ee99e5..d1a6745849a7 100644
--- a/security/selinux/ss/symtab.c
+++ b/security/selinux/ss/symtab.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Implementation of the symbol table type. 2 * Implementation of the symbol table type.
3 * 3 *
4 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 4 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
5 */ 5 */
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/string.h> 7#include <linux/string.h>
diff --git a/security/selinux/ss/symtab.h b/security/selinux/ss/symtab.h
index ca422b42fbc0..0bc12d587d3a 100644
--- a/security/selinux/ss/symtab.h
+++ b/security/selinux/ss/symtab.h
@@ -4,7 +4,7 @@
4 * is arbitrary. The symbol table type is implemented 4 * is arbitrary. The symbol table type is implemented
5 * using the hash table type (hashtab). 5 * using the hash table type (hashtab).
6 * 6 *
7 * Author : Stephen Smalley, <sds@epoch.ncsc.mil> 7 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
8 */ 8 */
9#ifndef _SS_SYMTAB_H_ 9#ifndef _SS_SYMTAB_H_
10#define _SS_SYMTAB_H_ 10#define _SS_SYMTAB_H_