WORKAROUND/Smack: ignore socket and pipe inods for smack_file_receive 61/47861/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 9 Sep 2015 05:21:49 +0000 (14:21 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 9 Sep 2015 10:56:42 +0000 (19:56 +0900)
This patch fixes to ignore socket and pipe inode for smack_file_receive as
workaround. It will be fixed on mainline smack and at that time this patch
should be reverted.

Change-Id: If5211b22b39c77e70597704fa06ae3f6276d0b8c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
security/smack/smack_lsm.c

index bb3f6041552dac97b24523c683b77c5d7375b99e..0e2c7ae6ffa23de33e88377f89cdca6ce73dbf19 100644 (file)
@@ -1641,6 +1641,9 @@ static int smack_file_receive(struct file *file)
        if (unlikely(IS_PRIVATE(inode)))
                return 0;
 
+       if (unlikely(S_ISSOCK(inode->i_mode) || S_ISFIFO(inode->i_mode)))
+               return 0;
+
        smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
        smk_ad_setfield_u_fs_path(&ad, file->f_path);
        /*