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] [day] [month] [year] [list]
Message-ID: <202109130912.F061D2E1@keescook>
Date:   Mon, 13 Sep 2021 09:16:57 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Mickaël Salaün <mic@...ikod.net>
Cc:     James Morris <jmorris@...ei.org>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] landlock: Drop "const" argument qualifier to avoid GCC
 4.9 warnings

On Mon, Sep 13, 2021 at 01:19:19PM +0200, Mickaël Salaün wrote:
> 
> On 11/09/2021 00:36, Kees Cook wrote:
> > When building under GCC 4.9, the compiler warns about const mismatches:
> > 
> > security/landlock/ruleset.c: In function 'insert_rule':
> > security/landlock/ruleset.c:196:34: error: passing argument 2 of 'create_rule' from incompatible pointer type [-Werror]
> >    new_rule = create_rule(object, &this->layers, this->num_layers,
> >                                   ^
> > security/landlock/ruleset.c:69:30: note: expected 'const struct landlock_layer ** const' but argument is of type 'struct landlock_layer (*)[]'
> >  static struct landlock_rule *create_rule(
> >                               ^
> > security/landlock/ruleset.c: In function 'landlock_insert_rule':
> > security/landlock/ruleset.c:240:38: error: passing argument 3 of 'insert_rule' from incompatible pointer type [-Werror]
> >   return insert_rule(ruleset, object, &layers, ARRAY_SIZE(layers));
> >                                       ^
> > security/landlock/ruleset.c:144:12: note: expected 'const struct landlock_layer ** const' but argument is of type 'struct landlock_layer (*)[1]'
> >  static int insert_rule(struct landlock_ruleset *const ruleset,
> 
> I guess this is a bug in GCC 4.9 (i.e. missing automatic const upgrade).
> Couldn't we backport a fix to GCC 4.9 instead?

I don't disagree, but I'm just trying to deal with the fall-out of
-Werror. Perhaps speak up on this thread in support of deprecating
GCC 4.9?

https://lore.kernel.org/lkml/20210910234047.1019925-1-ndesaulniers@google.com/

-Kees

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ