All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>,
	selinux@tycho.nsa.gov
Subject: Re: [PATCH] selinux: Don't sleep inside inode_getsecid hook
Date: Fri, 19 Feb 2016 16:34:44 -0500	[thread overview]
Message-ID: <1572416.CTbVzmqk7R@sifl> (raw)
In-Reply-To: <1455793448-26143-1-git-send-email-agruenba@redhat.com>

On Thursday, February 18, 2016 12:04:08 PM Andreas Gruenbacher wrote:
> The inode_getsecid hook is called from contexts in which sleeping is not
> allowed, so we cannot revalidate inode security labels from there. Use
> the non-validating version of inode_security() instead.
> 
> Reported-by: Benjamin Coddington <bcodding@redhat.com>
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  security/selinux/hooks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks.  I've applied this to the stable-4.5 branch and I'll send this up to 
James as soon as I've done some sanity checks.

> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index f8110cf..f1ab715 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3249,7 +3249,7 @@ static int selinux_inode_listsecurity(struct inode
> *inode, char *buffer, size_t
> 
>  static void selinux_inode_getsecid(struct inode *inode, u32 *secid)
>  {
> -	struct inode_security_struct *isec = inode_security(inode);
> +	struct inode_security_struct *isec = inode_security_novalidate(inode);
>  	*secid = isec->sid;
>  }

-- 
paul moore
www.paul-moore.com

      parent reply	other threads:[~2016-02-19 21:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 11:04 [PATCH] selinux: Don't sleep inside inode_getsecid hook Andreas Gruenbacher
2016-02-18 13:53 ` Stephen Smalley
2016-02-18 14:04   ` Andreas Gruenbacher
2016-02-19 21:34 ` Paul Moore [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=1572416.CTbVzmqk7R@sifl \
    --to=paul@paul-moore.com \
    --cc=agruenba@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /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.