Re: [PATCH] lsm: constify 'sb' parameter in security_sb_remount()

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

 



On Wed, Aug 23, 2023 at 8:44 AM Mickaël Salaün <mic@xxxxxxxxxxx> wrote:
>
> 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@xxxxxxxxx>
> > ---
> >  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]

Hi Khadija, can you please format the security/landlock/fs.c change as
requested by Mickaël?

You can find information on running clang-format on the Linux kernel
at the link below:
* https://www.kernel.org/doc/html/next/process/clang-format.html

-- 
paul-moore.com




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

  Powered by Linux