Smack: ignore private inode for smack_file_receive
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 17 Apr 2015 06:25:04 +0000 (15:25 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 3 Jun 2016 07:00:13 +0000 (16:00 +0900)
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: Iedc8901eb119095054f54c261157adb61d8dad30
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
security/smack/smack_lsm.c

index 5c4bda3..65f9474 100644 (file)
@@ -1702,6 +1702,9 @@ static int smack_file_receive(struct file *file)
        struct task_smack *tsp;
        struct socket_smack *ssp;
 
+       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);