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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38ef6320-76c4-4e5a-b930-151aeba6c739@schaufler-ca.com>
Date:   Tue, 7 Nov 2023 09:24:11 -0800
From:   Casey Schaufler <casey@...aufler-ca.com>
To:     Roberto Sassu <roberto.sassu@...weicloud.com>,
        viro@...iv.linux.org.uk, brauner@...nel.org,
        chuck.lever@...cle.com, jlayton@...nel.org, neilb@...e.de,
        kolga@...app.com, Dai.Ngo@...cle.com, tom@...pey.com,
        paul@...l-moore.com, jmorris@...ei.org, serge@...lyn.com,
        zohar@...ux.ibm.com, dmitry.kasatkin@...il.com,
        dhowells@...hat.com, jarkko@...nel.org,
        stephen.smalley.work@...il.com, eparis@...isplace.org,
        mic@...ikod.net
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-nfs@...r.kernel.org, linux-security-module@...r.kernel.org,
        linux-integrity@...r.kernel.org, keyrings@...r.kernel.org,
        selinux@...r.kernel.org, Roberto Sassu <roberto.sassu@...wei.com>,
        Stefan Berger <stefanb@...ux.ibm.com>,
        Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH v5 04/23] ima: Align ima_inode_removexattr() definition
 with LSM infrastructure

On 11/7/2023 5:39 AM, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@...wei.com>
>
> Change ima_inode_removexattr() definition, so that it can be registered as
> implementation of the inode_removexattr hook.
>
> Signed-off-by: Roberto Sassu <roberto.sassu@...wei.com>
> Reviewed-by: Stefan Berger <stefanb@...ux.ibm.com>

Reviewed-by: Casey Schaufler <casey@...aufler-ca.com>


> ---
>  include/linux/ima.h                   | 7 +++++--
>  security/integrity/ima/ima_appraise.c | 3 ++-
>  security/security.c                   | 2 +-
>  3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/ima.h b/include/linux/ima.h
> index 077324309c11..678a03fddd7e 100644
> --- a/include/linux/ima.h
> +++ b/include/linux/ima.h
> @@ -200,7 +200,9 @@ static inline int ima_inode_remove_acl(struct mnt_idmap *idmap,
>  {
>  	return ima_inode_set_acl(idmap, dentry, acl_name, NULL);
>  }
> -extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
> +
> +extern int ima_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry,
> +				 const char *xattr_name);
>  #else
>  static inline bool is_ima_appraise_enabled(void)
>  {
> @@ -231,7 +233,8 @@ static inline int ima_inode_set_acl(struct mnt_idmap *idmap,
>  	return 0;
>  }
>  
> -static inline int ima_inode_removexattr(struct dentry *dentry,
> +static inline int ima_inode_removexattr(struct mnt_idmap *idmap,
> +					struct dentry *dentry,
>  					const char *xattr_name)
>  {
>  	return 0;
> diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c
> index cb2d0d11aa77..36abc84ba299 100644
> --- a/security/integrity/ima/ima_appraise.c
> +++ b/security/integrity/ima/ima_appraise.c
> @@ -790,7 +790,8 @@ int ima_inode_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
>  	return 0;
>  }
>  
> -int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name)
> +int ima_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry,
> +			  const char *xattr_name)
>  {
>  	int result;
>  
> diff --git a/security/security.c b/security/security.c
> index ec5c8065ea36..358ec01a5492 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -2430,7 +2430,7 @@ int security_inode_removexattr(struct mnt_idmap *idmap,
>  		ret = cap_inode_removexattr(idmap, dentry, name);
>  	if (ret)
>  		return ret;
> -	ret = ima_inode_removexattr(dentry, name);
> +	ret = ima_inode_removexattr(idmap, dentry, name);
>  	if (ret)
>  		return ret;
>  	return evm_inode_removexattr(idmap, dentry, name);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ