aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2012-10-09 10:56:25 -0400
committerEric Paris <eparis@redhat.com>2013-07-25 13:03:01 -0400
commit12f348b9dcf6d9616c86a049c3c8700f9dc0af55 (patch)
treebbbf51b7b544926ab9140e58380c8155855287bd /security/selinux
parentaf8e50cc7d546c508e9091bbbdf3cf8b243bd8cd (diff)
SELinux: rename SE_SBLABELSUPP to SBLABEL_MNT
Just a flag rename as we prepare to make it not so special. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c28
-rw-r--r--security/selinux/include/security.h2
2 files changed, 15 insertions, 15 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e13d65a62104..344f4f999681 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -387,7 +387,7 @@ static int sb_finish_set_opts(struct super_block *sb)
387 } 387 }
388 } 388 }
389 389
390 sbsec->flags |= (SE_SBINITIALIZED | SE_SBLABELSUPP); 390 sbsec->flags |= (SE_SBINITIALIZED | SBLABEL_MNT);
391 391
392 if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) 392 if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
393 printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n", 393 printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
@@ -401,18 +401,18 @@ static int sb_finish_set_opts(struct super_block *sb)
401 sbsec->behavior == SECURITY_FS_USE_MNTPOINT || 401 sbsec->behavior == SECURITY_FS_USE_MNTPOINT ||
402 sbsec->behavior == SECURITY_FS_USE_NONE || 402 sbsec->behavior == SECURITY_FS_USE_NONE ||
403 sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) 403 sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
404 sbsec->flags &= ~SE_SBLABELSUPP; 404 sbsec->flags &= ~SBLABEL_MNT;
405 405
406 /* Special handling for sysfs. Is genfs but also has setxattr handler*/ 406 /* Special handling for sysfs. Is genfs but also has setxattr handler*/
407 if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 0) 407 if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 0)
408 sbsec->flags |= SE_SBLABELSUPP; 408 sbsec->flags |= SBLABEL_MNT;
409 409
410 /* 410 /*
411 * Special handling for rootfs. Is genfs but supports 411 * Special handling for rootfs. Is genfs but supports
412 * setting SELinux context on in-core inodes. 412 * setting SELinux context on in-core inodes.
413 */ 413 */
414 if (strncmp(sb->s_type->name, "rootfs", sizeof("rootfs")) == 0) 414 if (strncmp(sb->s_type->name, "rootfs", sizeof("rootfs")) == 0)
415 sbsec->flags |= SE_SBLABELSUPP; 415 sbsec->flags |= SBLABEL_MNT;
416 416
417 /* Initialize the root inode. */ 417 /* Initialize the root inode. */
418 rc = inode_doinit_with_dentry(root_inode, root); 418 rc = inode_doinit_with_dentry(root_inode, root);
@@ -477,7 +477,7 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
477 tmp >>= 1; 477 tmp >>= 1;
478 } 478 }
479 /* Check if the Label support flag is set */ 479 /* Check if the Label support flag is set */
480 if (sbsec->flags & SE_SBLABELSUPP) 480 if (sbsec->flags & SBLABEL_MNT)
481 opts->num_mnt_opts++; 481 opts->num_mnt_opts++;
482 482
483 opts->mnt_opts = kcalloc(opts->num_mnt_opts, sizeof(char *), GFP_ATOMIC); 483 opts->mnt_opts = kcalloc(opts->num_mnt_opts, sizeof(char *), GFP_ATOMIC);
@@ -524,9 +524,9 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
524 opts->mnt_opts[i] = context; 524 opts->mnt_opts[i] = context;
525 opts->mnt_opts_flags[i++] = ROOTCONTEXT_MNT; 525 opts->mnt_opts_flags[i++] = ROOTCONTEXT_MNT;
526 } 526 }
527 if (sbsec->flags & SE_SBLABELSUPP) { 527 if (sbsec->flags & SBLABEL_MNT) {
528 opts->mnt_opts[i] = NULL; 528 opts->mnt_opts[i] = NULL;
529 opts->mnt_opts_flags[i++] = SE_SBLABELSUPP; 529 opts->mnt_opts_flags[i++] = SBLABEL_MNT;
530 } 530 }
531 531
532 BUG_ON(i != opts->num_mnt_opts); 532 BUG_ON(i != opts->num_mnt_opts);
@@ -615,7 +615,7 @@ static int selinux_set_mnt_opts(struct super_block *sb,
615 for (i = 0; i < num_opts; i++) { 615 for (i = 0; i < num_opts; i++) {
616 u32 sid; 616 u32 sid;
617 617
618 if (flags[i] == SE_SBLABELSUPP) 618 if (flags[i] == SBLABEL_MNT)
619 continue; 619 continue;
620 rc = security_context_to_sid(mount_options[i], 620 rc = security_context_to_sid(mount_options[i],
621 strlen(mount_options[i]), &sid); 621 strlen(mount_options[i]), &sid);
@@ -1025,7 +1025,7 @@ static void selinux_write_opts(struct seq_file *m,
1025 case DEFCONTEXT_MNT: 1025 case DEFCONTEXT_MNT:
1026 prefix = DEFCONTEXT_STR; 1026 prefix = DEFCONTEXT_STR;
1027 break; 1027 break;
1028 case SE_SBLABELSUPP: 1028 case SBLABEL_MNT:
1029 seq_putc(m, ','); 1029 seq_putc(m, ',');
1030 seq_puts(m, LABELSUPP_STR); 1030 seq_puts(m, LABELSUPP_STR);
1031 continue; 1031 continue;
@@ -1624,7 +1624,7 @@ static int may_create(struct inode *dir,
1624 if (rc) 1624 if (rc)
1625 return rc; 1625 return rc;
1626 1626
1627 if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { 1627 if (!newsid || !(sbsec->flags & SBLABEL_MNT)) {
1628 rc = security_transition_sid(sid, dsec->sid, tclass, 1628 rc = security_transition_sid(sid, dsec->sid, tclass,
1629 &dentry->d_name, &newsid); 1629 &dentry->d_name, &newsid);
1630 if (rc) 1630 if (rc)
@@ -2412,7 +2412,7 @@ static int selinux_sb_remount(struct super_block *sb, void *data)
2412 u32 sid; 2412 u32 sid;
2413 size_t len; 2413 size_t len;
2414 2414
2415 if (flags[i] == SE_SBLABELSUPP) 2415 if (flags[i] == SBLABEL_MNT)
2416 continue; 2416 continue;
2417 len = strlen(mount_options[i]); 2417 len = strlen(mount_options[i]);
2418 rc = security_context_to_sid(mount_options[i], len, &sid); 2418 rc = security_context_to_sid(mount_options[i], len, &sid);
@@ -2546,7 +2546,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
2546 if ((sbsec->flags & SE_SBINITIALIZED) && 2546 if ((sbsec->flags & SE_SBINITIALIZED) &&
2547 (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) 2547 (sbsec->behavior == SECURITY_FS_USE_MNTPOINT))
2548 newsid = sbsec->mntpoint_sid; 2548 newsid = sbsec->mntpoint_sid;
2549 else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { 2549 else if (!newsid || !(sbsec->flags & SBLABEL_MNT)) {
2550 rc = security_transition_sid(sid, dsec->sid, 2550 rc = security_transition_sid(sid, dsec->sid,
2551 inode_mode_to_security_class(inode->i_mode), 2551 inode_mode_to_security_class(inode->i_mode),
2552 qstr, &newsid); 2552 qstr, &newsid);
@@ -2568,7 +2568,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
2568 isec->initialized = 1; 2568 isec->initialized = 1;
2569 } 2569 }
2570 2570
2571 if (!ss_initialized || !(sbsec->flags & SE_SBLABELSUPP)) 2571 if (!ss_initialized || !(sbsec->flags & SBLABEL_MNT))
2572 return -EOPNOTSUPP; 2572 return -EOPNOTSUPP;
2573 2573
2574 if (name) { 2574 if (name) {
@@ -2776,7 +2776,7 @@ static int selinux_inode_setxattr(struct dentry *dentry, const char *name,
2776 return selinux_inode_setotherxattr(dentry, name); 2776 return selinux_inode_setotherxattr(dentry, name);
2777 2777
2778 sbsec = inode->i_sb->s_security; 2778 sbsec = inode->i_sb->s_security;
2779 if (!(sbsec->flags & SE_SBLABELSUPP)) 2779 if (!(sbsec->flags & SBLABEL_MNT))
2780 return -EOPNOTSUPP; 2780 return -EOPNOTSUPP;
2781 2781
2782 if (!inode_owner_or_capable(inode)) 2782 if (!inode_owner_or_capable(inode))
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index 6d3885165d14..7ec750609cca 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -52,7 +52,7 @@
52/* Non-mount related flags */ 52/* Non-mount related flags */
53#define SE_SBINITIALIZED 0x10 53#define SE_SBINITIALIZED 0x10
54#define SE_SBPROC 0x20 54#define SE_SBPROC 0x20
55#define SE_SBLABELSUPP 0x40 55#define SBLABEL_MNT 0x40
56 56
57#define CONTEXT_STR "context=" 57#define CONTEXT_STR "context="
58#define FSCONTEXT_STR "fscontext=" 58#define FSCONTEXT_STR "fscontext="