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:   Tue, 28 Mar 2023 11:07:44 +0200 (CEST)
From:   Miroslav Benes <mbenes@...e.cz>
To:     Josh Poimboeuf <jpoimboe@...nel.org>
cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 4/5] objtool: Add per-function rate limiting for unreachable
 warnings

On Mon, 27 Mar 2023, Josh Poimboeuf wrote:

> Unreachable instruction warnings are rate limited to once per object
> file.  That no longer makes sense for vmlinux validation, which might
> have other unreachable instructions lurking in other places.  Change it
> to once per function.
> 
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> ---
>  tools/objtool/check.c               | 4 ++++
>  tools/objtool/include/objtool/elf.h | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 73dd091c0075..67a684225702 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -4557,6 +4557,10 @@ static int validate_reachable_instructions(struct objtool_file *file)
>  		if (insn->visited || ignore_unreachable_insn(file, insn))
>  			continue;
>  
> +		if (insn->sym->warned)
> +			continue;
> +		insn->sym->warned = 1;
> +

Ok

>  		WARN_FUNC("unreachable instruction", insn->sec, insn->offset);
>  		return 1;

But we still return here when an unreachable instruction is encountered 
and warned about. Or maybe I am just misunderstanding the purpose.

If not, would it be better to just collect the number of warnings per 
object as we do elsewhere?

  warnings++;

and then at the end

  return warnings;

Miroslav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ