diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2008-09-22 15:41:19 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-09-29 10:26:53 -0400 |
commit | ea6b184f7d521a503ecab71feca6e4057562252b (patch) | |
tree | 89724ca76ba9bc8a7029f3fd3edc49557ec6ab40 /security | |
parent | de45e806a84909648623119dfe6fc1d31e71ceba (diff) |
selinux: use default proc sid on symlinks
As we are not concerned with fine-grained control over reading of
symlinks in proc, always use the default proc SID for all proc symlinks.
This should help avoid permission issues upon changes to the proc tree
as in the /proc/net -> /proc/self/net example.
This does not alter labeling of symlinks within /proc/pid directories.
ls -Zd /proc/net output before and after the patch should show the difference.
Signed-off-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 89f446d86054..4a7374c12d9c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -1291,7 +1291,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent | |||
1291 | /* Default to the fs superblock SID. */ | 1291 | /* Default to the fs superblock SID. */ |
1292 | isec->sid = sbsec->sid; | 1292 | isec->sid = sbsec->sid; |
1293 | 1293 | ||
1294 | if (sbsec->proc) { | 1294 | if (sbsec->proc && !S_ISLNK(inode->i_mode)) { |
1295 | struct proc_inode *proci = PROC_I(inode); | 1295 | struct proc_inode *proci = PROC_I(inode); |
1296 | if (proci->pde) { | 1296 | if (proci->pde) { |
1297 | isec->sclass = inode_mode_to_security_class(inode->i_mode); | 1297 | isec->sclass = inode_mode_to_security_class(inode->i_mode); |