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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z44FHR2Z_i54PHfJ@gmail.com>
Date: Mon, 20 Jan 2025 09:11:09 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
	Waiman Long <longman@...hat.com>,
	Nathan Chancellor <nathan@...nel.org>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH v1 1/1] lockdep: Mark chain_hlock_class_idx() with
 __maybe_unused


* Boqun Feng <boqun.feng@...il.com> wrote:

> On Sun, Dec 15, 2024 at 11:21:36PM +0200, Andy Shevchenko wrote:
> > On Sun, Dec 15, 2024 at 11:55:08AM -0800, Boqun Feng wrote:
> > > On Mon, Dec 09, 2024 at 07:08:10PM +0200, Andy Shevchenko wrote:
> > > > When chain_hlock_class_idx() is unused, it prevents kernel builds with clang,
> > > > `make W=1` and CONFIG_WERROR=y:
> > > > 
> > > > kernel/locking/lockdep.c:435:28: error: unused function 'chain_hlock_class_idx' [-Werror,-Wunused-function]
> > > > 
> > > > Fix this by marking it with __maybe_unused.
> > > > 
> > > > See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> > > > inline functions for W=1 build").
> > > > 
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > > 
> > > This looks fine to me, so I'm going to queue it, but could you do me
> > > favor if you could share the exact configs that would make
> > > chain_hlock_class_idx() an unused fuction in kernel/locking/lockdep.c ?
> > 
> > I might harvest this when I come from vacations (some around mid-January).
> > 
> 
> After some investigation myself, it turns out that
> chain_hlock_class_idx() is defined outside "#ifdef CONFIG_PROVING_LOCK",
> but only used under CONFIG_PROVING_LOCK=y, hence the unused warning.
> 
> TBH, I feel we should really clean-up/consolidate those "#ifdef" to make
> internal definition/usage more clear. But nothing blocks this patch, it
> fixes a real issue, I will add the CONFIG_PROVING_LOCK part in the
> commit log. Thanks!

So now that we have:

   343060092585 lockdep: Move lockdep_assert_locked() under #ifdef CONFIG_PROVE_LOCKING

Do we really need:

   8148fa2e022b lockdep: Mark chain_hlock_class_idx() with __maybe_unused

As it would hide the problem fixed by 343060092585?

__maybe_unused annotations are almost always canaries of something 
messy being hidden.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ