Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933755AbbDPNlJ (ORCPT ); Thu, 16 Apr 2015 09:41:09 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:28354 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933718AbbDPNlB (ORCPT ); Thu, 16 Apr 2015 09:41:01 -0400 X-AuditID: cbfee68f-f793b6d000005f66-e5-552fbbcdb1a3 From: Seung-Woo Kim To: james.l.morris@oracle.com, serge@hallyn.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: sw0312.kim@samsung.com, sumit.semwal@linaro.org, linaro-mm-sig@lists.linaro.org, jy0922.shim@samsung.com Subject: [RFC PATCH] Security: ignore private inode from security_file_receive Date: Thu, 16 Apr 2015 22:40:56 +0900 Message-id: <1429191656-8866-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsWyRsSkQPfsbv1Qg73HBCz6HgdZvLh3kcXi y5WHTBaXd81hs/jQ84jN4vyFc+wWp+5+ZreYMfklmwOHx7XdkR53ru1h87j97zGzx8ent1g8 +rasYvT4vEkugC2KyyYlNSezLLVI3y6BK+PMl3b2goMcFdO3f2BvYPzO1sXIySEhYCJx8/wC KFtM4sK99UA2F4eQwFJGiW//dzN1MXKAFT37lwMRX8QocfPfR0YI5wejxK/jEJPYBHQk9i/5 zQrSICJQJrFjZRJImFkgT2L3i0WsILawgJ/Ezdnf2EFsFgFViaufpzKC2LwCrhJ7Pm5hgThC QWLBvbdgR0gIdLNLLL31mwmiQUDi2+RDLBAHyUpsOsAMUS8pcXDFDZYJjIILGBlWMYqmFiQX FCelFxnrFSfmFpfmpesl5+duYgQG8el/z/p3MN49YH2IUYCDUYmH1yNBP1SINbGsuDL3EKMp 0IaJzFKiyfnAWMkriTc0NjOyMDUxNTYytzRTEuddKPUzWEgg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WYi4oTAWa62TOnAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1297 Lines: 42 The dma-buf fd from anon_inode can be shared across processes, but there is no way to set security permission for the fd. So this patch fix just to ignore private inode from security_file_receive. Signed-off-by: Seung-Woo Kim --- If security like smack is enabled, the dmabuf fd can not be shared between processes via unix domain socket. I am not familiar with security, so I am not sure that this kind of patch can be acceptable. Is there other option to share dmabuf fd via socket with security check? Best Regards, - Seung-Woo Kim --- security/security.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/security/security.c b/security/security.c index 730ac65..c57354c 100644 --- a/security/security.c +++ b/security/security.c @@ -810,6 +810,9 @@ int security_file_send_sigiotask(struct task_struct *tsk, int security_file_receive(struct file *file) { + + if (unlikely(IS_PRIVATE(file->f_path.dentry->d_inode))) + return 0; return security_ops->file_receive(file); } -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/