Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35638
b: refs/heads/master
c: 296fddf
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris authored and Linus Torvalds committed Sep 26, 2006
1 parent 7924bc2 commit 62d7769
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3f8771420737004da55159c2f2dc0b6f483a4ef
refs/heads/master: 296fddf7513c155adbd3a443d12add1f62b5cddb
27 changes: 7 additions & 20 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,25 +1364,6 @@ static inline u32 file_to_av(struct file *file)
return av;
}

/* Set an inode's SID to a specified value. */
static int inode_security_set_sid(struct inode *inode, u32 sid)
{
struct inode_security_struct *isec = inode->i_security;
struct superblock_security_struct *sbsec = inode->i_sb->s_security;

if (!sbsec->initialized) {
/* Defer initialization to selinux_complete_init. */
return 0;
}

down(&isec->sem);
isec->sclass = inode_mode_to_security_class(inode->i_mode);
isec->sid = sid;
isec->initialized = 1;
up(&isec->sem);
return 0;
}

/* Hook functions begin here. */

static int selinux_ptrace(struct task_struct *parent, struct task_struct *child)
Expand Down Expand Up @@ -2091,7 +2072,13 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
}
}

inode_security_set_sid(inode, newsid);
/* Possibly defer initialization to selinux_complete_init. */
if (sbsec->initialized) {
struct inode_security_struct *isec = inode->i_security;
isec->sclass = inode_mode_to_security_class(inode->i_mode);
isec->sid = newsid;
isec->initialized = 1;
}

if (!ss_initialized || sbsec->behavior == SECURITY_FS_USE_MNTPOINT)
return -EOPNOTSUPP;
Expand Down

0 comments on commit 62d7769

Please sign in to comment.