Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbbDPPfw (ORCPT ); Thu, 16 Apr 2015 11:35:52 -0400 Received: from smtp103.biz.mail.bf1.yahoo.com ([98.139.221.62]:24557 "EHLO smtp103.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498AbbDPPfm (ORCPT ); Thu, 16 Apr 2015 11:35:42 -0400 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 9MA1a0cVM1m4wYr9oYw5ZIP62F8KgQ17pjSz4OipAGBteT4 edcutj9m.mlYYmu_zjupoKEjAoCaXUSVxutk9w.GIhThiWE6_1isA20YyTEz f0R3FkL8WufpWxa9TQIaZ7ELmrSwCscc7FAgxP85jiTi3.LiqeArUVo1npSp jLgkpFQrGGEqb65v6egFATU45g8pFBmz61lXw8v48rAohBOdmU0xN2scuPpK HVBusLnj38WGc654hP_CaQ57xFYqRIpb4BJMswNT_9pIy0128Mk8RGXmhOIV PWarxKVQu4vAq3Del.KxMHZ2xXHtyu8ugjX1p73C3cakUUfADK6Cd1XjieCU 9Ruom.yS6_zCdddPZkkvPnqGaYxtQF7bA6sfDBv8xnYI3G.Zrdy4l88puM1F 89wK_N7oy11rAVMw8dpiCdMaJJDBAT8acmU23CFKy4Fc8oQw5BOcqgfYQjZ2 .HoIbeT.1szlI0y6XDMmVslj4WxtpDR7Mel2S2UBMn70rByf8ubSCXf8yv91 Lg30DvvTv4qAD.DjPYa79Hs387ZQBUDDV1ec- X-Yahoo-SMTP: OIJXglSswBDfgLtXluJ6wiAYv6_cnw-- Message-ID: <552FD6C9.8060605@schaufler-ca.com> Date: Thu, 16 Apr 2015 08:35:37 -0700 From: Casey Schaufler User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Seung-Woo Kim , james.l.morris@oracle.com, serge@hallyn.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org CC: sumit.semwal@linaro.org, linaro-mm-sig@lists.linaro.org, jy0922.shim@samsung.com, Casey Schaufler Subject: Re: [RFC PATCH] Security: ignore private inode from security_file_receive References: <1429191656-8866-1-git-send-email-sw0312.kim@samsung.com> In-Reply-To: <1429191656-8866-1-git-send-email-sw0312.kim@samsung.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1686 Lines: 49 On 4/16/2015 6:40 AM, Seung-Woo Kim wrote: > 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. If an IS_PRIVATE() check is appropriate, it should be in smack_file_receive(), not security_file_receive(). Why are you looking at file->f_path.dentry->d_inode? That's not used in the Smack access check. You'd want file->f_inode if anything. Naked-by: Casey Schaufler > > 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); > } > -- 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/