lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100714023048.GB17686@hallyn.com>
Date:	Tue, 13 Jul 2010 21:30:48 -0500
From:	"Serge E. Hallyn" <serge@...lyn.com>
To:	Kees Cook <kees.cook@...onical.com>
Cc:	linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Yama: verify inode is symlink to avoid bind mounts

Quoting Kees Cook (kees.cook@...onical.com):
> The inode_follow_link LSM hook is called in bind mount situations as
> well as for symlink situations, so we must explicitly check for the
> inode being a symlink to not reject bind mounts in 1777 directories,

Are you sure about that??

If that's true, you might also expand the comment in
include/linux/security.h.

> which seems to be a common NFSv4 configuration.
> 
> Signed-off-by: Kees Cook <kees.cook@...onical.com>
> ---
>  security/yama/yama_lsm.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
> index 3b76386..c70eb10 100644
> --- a/security/yama/yama_lsm.c
> +++ b/security/yama/yama_lsm.c
> @@ -116,6 +116,10 @@ static int yama_inode_follow_link(struct dentry *dentry,
>  	if (!protected_sticky_symlinks)
>  		return 0;
>  
> +	/* if inode isn't a symlink, don't try to evaluate blocking it */
> +	if (!S_ISLNK(inode->i_mode))
> +		return 0;
> +
>  	/* owner and follower match? */
>  	cred = current_cred();
>  	inode = dentry->d_inode;
> -- 
> 1.7.1
> 
> 
> -- 
> Kees Cook
> Ubuntu Security Team
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ