Re: [PATCH] selinux: Don't sleep inside inode_getsecid hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
> ---
>  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

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux