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: <D8JC89FNMZIR.CWZT19Q743I7@google.com>
Date: Tue, 18 Mar 2025 10:59:17 +0000
From: Brendan Jackman <jackmanb@...gle.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>, <x86@...nel.org>, <linux-kernel@...r.kernel.org>, 
	Peter Zijlstra <peterz@...radead.org>, Nathan Chancellor <nathan@...nel.org>
Subject: Re: [PATCH 05/13] objtool: Increase per-function WARN_FUNC() rate limit

On Mon Mar 17, 2025 at 12:29 PM UTC, Miroslav Benes wrote:
> > > diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
> > > index ac04d3fe4dd9..6180288927fd 100644
> > > --- a/tools/objtool/include/objtool/warn.h
> > > +++ b/tools/objtool/include/objtool/warn.h
> > > @@ -53,14 +53,22 @@ static inline char *offstr(struct section *sec, unsigned long offset)
> > >  	free(_str);					\
> > >  })
> > >  
> > > +#define WARN_LIMIT 2
> > > +
> > >  #define WARN_INSN(insn, format, ...)					\
> > >  ({									\
> > >  	struct instruction *_insn = (insn);				\
> > > -	if (!_insn->sym || !_insn->sym->warned)				\
> > > +	BUILD_BUG_ON(WARN_LIMIT > 2);					\
> > 
> > Shouldn't this be >3? Anyway, I think it would be clearer if the
> > coupling was more explicit, e.g:
>
> I think it is correct but I also think that the difference between bits 
> and the actual number of "allowed" warnings can be confusing.

Oh, yeah sorry I did not read this properly. So it's using
(1<<nbits)-2 as the "report that we're skipping duplicates" special
value.

So IMO  we need something like:

/* Subtract one because the warnings==WARN_LIMIT is used to report skipped warnings. */
static_assert(WARN_LIMIT < (1 << STRUCT_SYMBOL_WARNING_BITS) - 1, "symbol.warnings too small");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ