aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorDavid Quigley <dpquigl@davequigley.com>2013-05-22 12:50:36 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-06-08 16:20:12 -0400
commit649f6e7718891fe7691e5084ce3fa623acba3129 (patch)
tree3e3cd7cd832749b88082825dfdf797f1695fed1d /include/linux/security.h
parent746df9b59c8a5f162c907796c7295d3c4c0d8995 (diff)
LSM: Add flags field to security_sb_set_mnt_opts for in kernel mount data.
There is no way to differentiate if a text mount option is passed from user space or the kernel. A flags field is being added to the security_sb_set_mnt_opts hook to allow for in kernel security flags to be sent to the LSM for processing in addition to the text options received from mount. This patch also updated existing code to fix compilation errors. Acked-by: Eric Paris <eparis@redhat.com> Acked-by: James Morris <james.l.morris@oracle.com> Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Miguel Rodel Felipe <Rodel_FM@dsi.a-star.edu.sg> Signed-off-by: Phua Eu Gene <PHUA_Eu_Gene@dsi.a-star.edu.sg> Signed-off-by: Khin Mi Mi Aung <Mi_Mi_AUNG@dsi.a-star.edu.sg> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index cff3e4fc4281..aa656fbc4308 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1456,7 +1456,9 @@ struct security_operations {
1456 int (*sb_pivotroot) (struct path *old_path, 1456 int (*sb_pivotroot) (struct path *old_path,
1457 struct path *new_path); 1457 struct path *new_path);
1458 int (*sb_set_mnt_opts) (struct super_block *sb, 1458 int (*sb_set_mnt_opts) (struct super_block *sb,
1459 struct security_mnt_opts *opts); 1459 struct security_mnt_opts *opts,
1460 unsigned long kern_flags,
1461 unsigned long *set_kern_flags);
1460 int (*sb_clone_mnt_opts) (const struct super_block *oldsb, 1462 int (*sb_clone_mnt_opts) (const struct super_block *oldsb,
1461 struct super_block *newsb); 1463 struct super_block *newsb);
1462 int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); 1464 int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts);
@@ -1747,7 +1749,10 @@ int security_sb_mount(const char *dev_name, struct path *path,
1747 const char *type, unsigned long flags, void *data); 1749 const char *type, unsigned long flags, void *data);
1748int security_sb_umount(struct vfsmount *mnt, int flags); 1750int security_sb_umount(struct vfsmount *mnt, int flags);
1749int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1751int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1750int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1752int security_sb_set_mnt_opts(struct super_block *sb,
1753 struct security_mnt_opts *opts,
1754 unsigned long kern_flags,
1755 unsigned long *set_kern_flags);
1751int security_sb_clone_mnt_opts(const struct super_block *oldsb, 1756int security_sb_clone_mnt_opts(const struct super_block *oldsb,
1752 struct super_block *newsb); 1757 struct super_block *newsb);
1753int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); 1758int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
@@ -2037,7 +2042,9 @@ static inline int security_sb_pivotroot(struct path *old_path,
2037} 2042}
2038 2043
2039static inline int security_sb_set_mnt_opts(struct super_block *sb, 2044static inline int security_sb_set_mnt_opts(struct super_block *sb,
2040 struct security_mnt_opts *opts) 2045 struct security_mnt_opts *opts,
2046 unsigned long kern_flags,
2047 unsigned long *set_kern_flags)
2041{ 2048{
2042 return 0; 2049 return 0;
2043} 2050}