aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2009-10-04 08:49:48 -0400
committerJames Morris <jmorris@namei.org>2009-10-11 19:56:02 -0400
commit8b8efb44033c7e86b3dc76f825c693ec92ae30e9 (patch)
tree8cf43afc59f88f36a86f3a8165770bccec28b3c3 /security
parent89eda06837094ce9f34fae269b8773fcfd70f046 (diff)
LSM: Add security_path_chroot().
This patch allows pathname based LSM modules to check chroot() operations. This hook is used by TOMOYO. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/capability.c6
-rw-r--r--security/security.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/security/capability.c b/security/capability.c
index 09279a8d4a1..4f3ab476937 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -319,6 +319,11 @@ static int cap_path_chown(struct path *path, uid_t uid, gid_t gid)
319{ 319{
320 return 0; 320 return 0;
321} 321}
322
323static int cap_path_chroot(struct path *root)
324{
325 return 0;
326}
322#endif 327#endif
323 328
324static int cap_file_permission(struct file *file, int mask) 329static int cap_file_permission(struct file *file, int mask)
@@ -990,6 +995,7 @@ void security_fixup_ops(struct security_operations *ops)
990 set_to_cap_if_null(ops, path_truncate); 995 set_to_cap_if_null(ops, path_truncate);
991 set_to_cap_if_null(ops, path_chmod); 996 set_to_cap_if_null(ops, path_chmod);
992 set_to_cap_if_null(ops, path_chown); 997 set_to_cap_if_null(ops, path_chown);
998 set_to_cap_if_null(ops, path_chroot);
993#endif 999#endif
994 set_to_cap_if_null(ops, file_permission); 1000 set_to_cap_if_null(ops, file_permission);
995 set_to_cap_if_null(ops, file_alloc_security); 1001 set_to_cap_if_null(ops, file_alloc_security);
diff --git a/security/security.c b/security/security.c
index 5259270e558..279757314a0 100644
--- a/security/security.c
+++ b/security/security.c
@@ -449,6 +449,11 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid)
449 return 0; 449 return 0;
450 return security_ops->path_chown(path, uid, gid); 450 return security_ops->path_chown(path, uid, gid);
451} 451}
452
453int security_path_chroot(struct path *path)
454{
455 return security_ops->path_chroot(path);
456}
452#endif 457#endif
453 458
454int security_inode_create(struct inode *dir, struct dentry *dentry, int mode) 459int security_inode_create(struct inode *dir, struct dentry *dentry, int mode)