summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2015-04-22 11:23:26 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:45:03 +0900
commit886b281e2bd24a85a3759b7ef9a1359465a94ec1 (patch)
treef2fca2a4839f50e2f25837d372094eee8a04d3ea /security
parent7ff5efabdc07d9dcdad0974ba69bbe382616860e (diff)
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> Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security')
-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 1a6881887c92..13933689d7a2 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -1671,6 +1671,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);
/*