From: Casey Schaufler <casey@schaufler-ca.com>
To: Seung-Woo Kim <sw0312.kim@samsung.com>,
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 <casey@schaufler-ca.com>
Subject: Re: [RFC PATCH] Security: ignore private inode from security_file_receive
Date: Thu, 16 Apr 2015 08:35:37 -0700 [thread overview]
Message-ID: <552FD6C9.8060605@schaufler-ca.com> (raw)
In-Reply-To: <1429191656-8866-1-git-send-email-sw0312.kim@samsung.com>
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 <sw0312.kim@samsung.com>
> ---
>
> 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 <casey@schaufler-ca.com>
>
> 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);
> }
>
prev parent reply other threads:[~2015-04-16 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 13:40 [RFC PATCH] Security: ignore private inode from security_file_receive Seung-Woo Kim
2015-04-16 13:48 ` Stephen Smalley
2015-04-17 2:00 ` Seung-Woo Kim
2015-04-16 15:35 ` Casey Schaufler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=552FD6C9.8060605@schaufler-ca.com \
--to=casey@schaufler-ca.com \
--cc=james.l.morris@oracle.com \
--cc=jy0922.shim@samsung.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=serge@hallyn.com \
--cc=sumit.semwal@linaro.org \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.