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]
Date:   Wed, 08 Mar 2023 10:47:52 -0500
From:   Mimi Zohar <zohar@...ux.ibm.com>
To:     Roberto Sassu <roberto.sassu@...weicloud.com>,
        viro@...iv.linux.org.uk, chuck.lever@...cle.com,
        jlayton@...nel.org, dmitry.kasatkin@...il.com, paul@...l-moore.com,
        jmorris@...ei.org, serge@...lyn.com, dhowells@...hat.com,
        jarkko@...nel.org, stephen.smalley.work@...il.com,
        eparis@...isplace.org, casey@...aufler-ca.com, brauner@...nel.org
Cc:     linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
        linux-integrity@...r.kernel.org,
        linux-security-module@...r.kernel.org, keyrings@...r.kernel.org,
        selinux@...r.kernel.org, linux-kernel@...r.kernel.org,
        stefanb@...ux.ibm.com, Roberto Sassu <roberto.sassu@...wei.com>
Subject: Re: [PATCH 18/28] security: Introduce path_post_mknod hook

Hi Roberto,

On Fri, 2023-03-03 at 19:18 +0100, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@...wei.com>
> 
> In preparation for moving IMA and EVM to the LSM infrastructure, introduce
> the path_post_mknod hook.
> 
> Signed-off-by: Roberto Sassu <roberto.sassu@...wei.com>
> ---
>  fs/namei.c                    |  2 ++
>  include/linux/lsm_hook_defs.h |  3 +++
>  include/linux/security.h      |  9 +++++++++
>  security/security.c           | 19 +++++++++++++++++++
>  4 files changed, 33 insertions(+)
> 
> diff --git a/fs/namei.c b/fs/namei.c
> index 41f7fdf4657..3f2747521d3 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -3980,6 +3980,8 @@ static int do_mknodat(int dfd, struct filename *name, umode_t mode,
>  					  dentry, mode, 0);
>  			break;
>  	}
> +	if (!error)
> +		security_path_post_mknod(idmap, &path, dentry, mode, dev);

Even though the original code uses "if (!error) ...",  consider using
"if (error) goto ..." here.

-- 
thanks,

Mimi


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ