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: <20230823.xeiYoo3BuPhu@digikod.net>
Date:   Wed, 23 Aug 2023 14:44:19 +0200
From:   Mickaël Salaün <mic@...ikod.net>
To:     Khadija Kamran <kamrankhadijadj@...il.com>
Cc:     Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Stephen Smalley <stephen.smalley.work@...il.com>,
        Eric Paris <eparis@...isplace.org>, selinux@...r.kernel.org,
        ztarkhani@...rosoft.com, alison.schofield@...el.com
Subject: Re: [PATCH] lsm: constify 'sb' parameter in security_sb_remount()

Hi Khadija,

On Wed, Aug 23, 2023 at 01:51:27PM +0500, Khadija Kamran wrote:
> The "sb_remount" hook has implementations registered in SELinux and
> Landlock. Looking at the function implementations we observe that the
> "sb" parameter is not changing.
> 
> Mark the "sb" parameter of LSM hook security_sb_remount() as "const"
> since it will not be changing in the LSM hook.
> 
> Signed-off-by: Khadija Kamran <kamrankhadijadj@...il.com>
> ---
>  include/linux/lsm_hook_defs.h | 2 +-
>  include/linux/security.h      | 2 +-
>  security/landlock/fs.c        | 2 +-
>  security/security.c           | 2 +-
>  security/selinux/hooks.c      | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)

> diff --git a/security/landlock/fs.c b/security/landlock/fs.c
> index 1c0c198f6fdb..fabe324922ec 100644
> --- a/security/landlock/fs.c
> +++ b/security/landlock/fs.c
> @@ -1074,7 +1074,7 @@ static int hook_sb_umount(struct vfsmount *const mnt, const int flags)
>  	return -EPERM;
>  }
>  
> -static int hook_sb_remount(struct super_block *const sb, void *const mnt_opts)
> +static int hook_sb_remount(const struct super_block *const sb, void *const mnt_opts)

Please format with clang-format -i security/landlock/*.[ch]

>  {
>  	if (!landlock_get_current_domain())
>  		return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ