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: <CAD=FV=W5HrBFakvoX-cQ5G=4xV1upkFPZ6aSR8me+d+aCpirgg@mail.gmail.com>
Date:   Tue, 23 May 2023 07:12:07 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Tom Rix <trix@...hat.com>
Cc:     akpm@...ux-foundation.org, pmladek@...e.com, kernelfans@...il.com,
        lecopzer.chen@...iatek.com, ldufour@...ux.ibm.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] watchdog: set variables watchdog_soft,hardlockup_user_enabled
 storage-class-specifier to static

Hi,

On Tue, May 23, 2023 at 5:23 AM Tom Rix <trix@...hat.com> wrote:
>
> smatch reports
> kernel/watchdog.c:40:19: warning: symbol
>   'watchdog_hardlockup_user_enabled' was not declared. Should it be static?
> kernel/watchdog.c:41:19: warning: symbol
>   'watchdog_softlockup_user_enabled' was not declared. Should it be static?
>
> These variabled are only used in their defining file, so it should be static.

s/variabled/variables

>
> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
>  kernel/watchdog.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

While your fix is valid (thanks!), it's only half the fix.

I wondered why smatch would have suddenly noticed this since the
change that touched this variable recently was only a rename. When I
dug deeper, I realized that the old names actually _were_ referenced
outside this file and my rename missed them. The reason I missed them
is that the only reference is an "extern" reference in
`include/linux/nmi.h`. The references in `include/linux/nmi.h`
probably should have been removed in commit dd0693fdf054 ("watchdog:
move watchdog sysctl interface to watchdog.c")

...so a more complete fix would also remove references to the old
names (nmi_watchdog_user_enabled and soft_watchdog_user_enabled) in
`include/linux/nmi.h`.

-Doug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ