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, 13 Apr 2023 10:01:12 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Josh Poimboeuf <jpoimboe@...nel.org>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Miroslav Benes <mbenes@...e.cz>
Subject: Re: [PATCH v2 3/9] objtool: Limit unreachable warnings to once per
 function

On Wed, Apr 12, 2023 at 12:03:18PM -0700, Josh Poimboeuf wrote:

> diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
> index b1c920dc9516..4ef9b278e5fd 100644
> --- a/tools/objtool/include/objtool/warn.h
> +++ b/tools/objtool/include/objtool/warn.h
> @@ -55,7 +55,10 @@ static inline char *offstr(struct section *sec, unsigned long offset)
>  
>  #define WARN_INSN(insn, format, ...)					\
>  ({									\
> -	WARN_FUNC(format, insn->sec, insn->offset,  ##__VA_ARGS__);	\
> +	if (!insn->sym || !insn->sym->warned)				\
> +		WARN_FUNC(format, insn->sec, insn->offset, ##__VA_ARGS__);\
> +	if (insn->sym)							\
> +		insn->sym->warned = 1;					\
>  })

Do we want to write that like:

#define WARN_INSN(insn, format, ...)					\
({									\
	struct instruction *_insn = (insn);				\
	if (!_insn->sym || !_insn->sym->warned)				\
		WARN_FUNC(format, _insn->sec, _insn->offset, ##__VA_ARGS__);\
	if (_insn->sym)							\
		_insn->sym->warned = 1;					\
})

instead ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ