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: <CAHC9VhRGtkiOMHvjPaM170FJu3kiVZq30n389_2Gg=QgOV=fUA@mail.gmail.com>
Date:   Thu, 17 Feb 2022 17:27:12 -0500
From:   Paul Moore <paul@...l-moore.com>
To:     Christian Göttsche <cgzones@...glemail.com>
Cc:     selinux@...r.kernel.org, James Morris <jmorris@...ei.org>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Casey Schaufler <casey@...aufler-ca.com>,
        Xin Long <lucien.xin@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Ondrej Mosnacek <omosnace@...hat.com>,
        Mickaël Salaün <mic@...ux.microsoft.com>,
        Todd Kjos <tkjos@...gle.com>,
        Olga Kornievskaia <kolga@...app.com>,
        linux-kernel@...r.kernel.org,
        linux-security-module@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] security: declare member holding string literal const

On Thu, Feb 17, 2022 at 9:19 AM Christian Göttsche
<cgzones@...glemail.com> wrote:
>
> The struct security_hook_list member lsm is assigned in
> security_add_hooks() with string literals passed from the individual
> security modules.  Declare the function parameter and the struct member
> const to signal their immutability.
>
> Reported by Clang [-Wwrite-strings]:
>
>     security/selinux/hooks.c:7388:63: error: passing 'const char [8]' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>             security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks), selinux);
>                                                                          ^~~~~~~~~
>     ./include/linux/lsm_hooks.h:1629:11: note: passing argument to parameter 'lsm' here
>                                     char *lsm);
>                                           ^
>
> Signed-off-by: Christian Göttsche <cgzones@...glemail.com>
> ---
>  include/linux/lsm_hooks.h | 4 ++--
>  security/security.c       | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Thanks Christian.

Reviewed-by: Paul Moore <paul@...l-moore.com>

-- 
paul-moore.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ