From 1e46fe9c73d52e2dea36a6f6dfadc33331351a2f Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 22 Apr 2015 11:23:26 +0900 Subject: [PATCH] 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. Change-Id: I1b5223ebf2fb1f810380c62096aa64a16b054057 Signed-off-by: Seung-Woo Kim Acked-by: Casey Schaufler --- security/smack/smack_lsm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 17ed8413eb37..bb3f6041552d 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -1638,6 +1638,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); /* -- 2.34.1