aboutsummaryrefslogtreecommitdiffstats
path: root/security/smack/smack_lsm.c
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2015-04-17 15:25:04 +0900
committerCasey Schaufler <casey@schaufler-ca.com>2015-05-15 08:35:50 -0700
commit9777582e8d604f69ce3a93805065e451487e26b4 (patch)
tree0f51c71806352e7ee311b16dfcc2485ff1166938 /security/smack/smack_lsm.c
parentLSM: Remove unused capability.c (diff)
downloadlinux-dev-9777582e8d604f69ce3a93805065e451487e26b4.tar.xz
linux-dev-9777582e8d604f69ce3a93805065e451487e26b4.zip
Smack: ignore private inode for smack_file_receive
The dmabuf fd can be shared between processes via unix domain socket. The file of dmabuf fd is came from anon_inode. The inode has no set and get xattr operations, so it can not be shared between processes with smack. This patch fixes just to ignore private inode including anon_inode for smack_file_receive. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'security/smack/smack_lsm.c')
-rw-r--r--security/smack/smack_lsm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 5eae42c8d0d5..f09b8c7cf1e7 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -1658,6 +1658,9 @@ static int smack_file_receive(struct file *file)
struct smk_audit_info ad;
struct inode *inode = file_inode(file);
+ if (unlikely(IS_PRIVATE(inode)))
+ return 0;
+
smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
smk_ad_setfield_u_fs_path(&ad, file->f_path);
/*