aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2016-09-20 21:54:19 -0400
committerJames Morris <james.l.morris@oracle.com>2016-09-20 21:54:19 -0400
commit8a17ef9d8543744a0c6a6f5fdc65b5770e7eaa64 (patch)
treef412a19b87ba5eb7ccb0a727ff2793e3456cd995 /security
parentde2f4b3453d29934ceb41eccebd55ab087e17d6c (diff)
parent43af5de74288a7cdc3684902c5259346ae67adf8 (diff)
Merge branch 'stable-4.9' of git://git.infradead.org/users/pcmoore/selinux into next
Diffstat (limited to 'security')
-rw-r--r--security/lsm_audit.c13
-rw-r--r--security/selinux/hooks.c16
2 files changed, 21 insertions, 8 deletions
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 9bf851884800..8bfa3147fd54 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -245,6 +245,19 @@ static void dump_common_audit_data(struct audit_buffer *ab,
245 } 245 }
246 break; 246 break;
247 } 247 }
248 case LSM_AUDIT_DATA_FILE: {
249 struct inode *inode;
250
251 audit_log_d_path(ab, " path=", &a->u.file->f_path);
252
253 inode = file_inode(a->u.file);
254 if (inode) {
255 audit_log_format(ab, " dev=");
256 audit_log_untrustedstring(ab, inode->i_sb->s_id);
257 audit_log_format(ab, " ino=%lu", inode->i_ino);
258 }
259 break;
260 }
248 case LSM_AUDIT_DATA_IOCTL_OP: { 261 case LSM_AUDIT_DATA_IOCTL_OP: {
249 struct inode *inode; 262 struct inode *inode;
250 263
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e15e56081c0c..2205ea27aa0a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1761,8 +1761,8 @@ static inline int file_path_has_perm(const struct cred *cred,
1761{ 1761{
1762 struct common_audit_data ad; 1762 struct common_audit_data ad;
1763 1763
1764 ad.type = LSM_AUDIT_DATA_PATH; 1764 ad.type = LSM_AUDIT_DATA_FILE;
1765 ad.u.path = file->f_path; 1765 ad.u.file = file;
1766 return inode_has_perm(cred, file_inode(file), av, &ad); 1766 return inode_has_perm(cred, file_inode(file), av, &ad);
1767} 1767}
1768 1768
@@ -1784,8 +1784,8 @@ static int file_has_perm(const struct cred *cred,
1784 u32 sid = cred_sid(cred); 1784 u32 sid = cred_sid(cred);
1785 int rc; 1785 int rc;
1786 1786
1787 ad.type = LSM_AUDIT_DATA_PATH; 1787 ad.type = LSM_AUDIT_DATA_FILE;
1788 ad.u.path = file->f_path; 1788 ad.u.file = file;
1789 1789
1790 if (sid != fsec->sid) { 1790 if (sid != fsec->sid) {
1791 rc = avc_has_perm(sid, fsec->sid, 1791 rc = avc_has_perm(sid, fsec->sid,
@@ -2365,8 +2365,8 @@ static int selinux_bprm_set_creds(struct linux_binprm *bprm)
2365 new_tsec->sid = old_tsec->sid; 2365 new_tsec->sid = old_tsec->sid;
2366 } 2366 }
2367 2367
2368 ad.type = LSM_AUDIT_DATA_PATH; 2368 ad.type = LSM_AUDIT_DATA_FILE;
2369 ad.u.path = bprm->file->f_path; 2369 ad.u.file = bprm->file;
2370 2370
2371 if (new_tsec->sid == old_tsec->sid) { 2371 if (new_tsec->sid == old_tsec->sid) {
2372 rc = avc_has_perm(old_tsec->sid, isec->sid, 2372 rc = avc_has_perm(old_tsec->sid, isec->sid,
@@ -3833,8 +3833,8 @@ static int selinux_kernel_module_from_file(struct file *file)
3833 3833
3834 /* finit_module */ 3834 /* finit_module */
3835 3835
3836 ad.type = LSM_AUDIT_DATA_PATH; 3836 ad.type = LSM_AUDIT_DATA_FILE;
3837 ad.u.path = file->f_path; 3837 ad.u.file = file;
3838 3838
3839 fsec = file->f_security; 3839 fsec = file->f_security;
3840 if (sid != fsec->sid) { 3840 if (sid != fsec->sid) {