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:   Thu, 28 Oct 2021 22:52:13 +0100
From:   Nick Alcock <nick.alcock@...cle.com>
To:     Nick Alcock <nick.alcock@...cle.com>, jeyu@...nel.org,
        masahiroy@...nel.org
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-modules@...r.kernel.org, linux-kernel@...r.kernel.org,
        arnd@...db.de, eugene.loh@...cle.com, kris.van.hees@...cle.com
Subject: Re: [PATCH v5 6/7] kallsyms: add /proc/kallmodsyms

For reference, and to be maximally pedantic:

On 28 Oct 2021, kernel test robot said:

> Hi Nick,
>
> Thank you for the patch! Perhaps something to improve:

Nope! This is a (very small) flaw in the !CONFIG_PROC_FS case in
include/linux/proc_fs.h. (I don't think one can seriously call it a
*bug*, as such.)

It's not a problem in this patch.

> config: hexagon-randconfig-r041-20211027 (attached as .config)

This config includes: 

# CONFIG_PROC_FS is not set

> All warnings (new ones prefixed by >>):
[unrelated warnings snipped]
>    static 
>    kernel/kallsyms.c:1054:30: warning: unused variable 'kallsyms_proc_ops' [-Wunused-const-variable]
>    static const struct proc_ops kallsyms_proc_ops = {
>                                 ^

This warning already existed (and doubtless countless others just like
it all over the tree in this configuration).  This is because
proc_create(), in the !CONFIG_PROC_FS case, is a #define that just does
nothing: so the compiler can see that none of its args are used, and
will complain about those that have no other references. The proc_ops is
almost certainly going to be one such.

The new warning is just the same:

>>> kernel/kallsyms.c:1062:30: warning: unused variable 'kallmodsyms_proc_ops' [-Wunused-const-variable]
>    static const struct proc_ops kallmodsyms_proc_ops = {
>                                 ^
>    3 warnings generated.

The kallmodsyms_proc_ops is obviously doing the same thing as
kallsyms_proc_ops (because it has to), so it gets the same warning.

Short of wrapping every single declaration of a proc_ops structure, and
every call to proc_create, in #ifdef CONFIG_PROC_FS (which is obviously
gross and exactly the thing the macro in proc_fs.h is intended to
avoid), there is no way of fixing this warning on its own: it must be
fixed in proc_fs.h. (Perhaps by making a bunch of those macros into
functions with __attribute__((__unused__)) attached to appropriate
args.)

-- 
NULL && (void)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ