Skip to content

Commit

Permalink
Smack: ignore private inode for smack_file_receive
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Seung-Woo Kim authored and Casey Schaufler committed May 15, 2015
1 parent 1ddd3b4 commit 9777582
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/*
Expand Down

0 comments on commit 9777582

Please sign in to comment.