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: <20230622114830.GM4253@hirez.programming.kicks-ass.net>
Date:   Thu, 22 Jun 2023 13:48:30 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Christophe Leroy <christophe.leroy@...roup.eu>
Cc:     Michael Ellerman <mpe@...erman.id.au>,
        Nicholas Piggin <npiggin@...il.com>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Sathvika Vasireddy <sv@...ux.ibm.com>,
        Naveen N Rao <naveen@...nel.org>,
        linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2 11/14] objtool: Remove too strict constraint in jump
 table search

On Thu, Jun 22, 2023 at 12:54:33PM +0200, Christophe Leroy wrote:
> In code there is often a pattern like:
> 
> 	load jump table address
> 	do some test
> 	conditional jump to label1:
> 	do something
> 	unconditional jump to label2:
> label1:
> 	do something else
> 	read jump table
> 	dynamic jump
> label2:
> 	do other job here ....
> 
> find_jump_table() contains a constraint that stops the backsearch
> of the table address loading when a jump is found in-between.
> 
> Remove that constraint.

Josh, happen to remember why this code exists ?

> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
>  tools/objtool/check.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index b810be087d7c..1911de0e1008 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -2130,13 +2130,6 @@ static struct reloc *find_jump_table(struct objtool_file *file,
>  		if (insn != orig_insn && insn->type == INSN_JUMP_DYNAMIC)
>  			break;
>  
> -		/* allow small jumps within the range */
> -		if (insn->type == INSN_JUMP_UNCONDITIONAL &&
> -		    insn->jump_dest &&
> -		    (insn->jump_dest->offset <= insn->offset ||
> -		     insn->jump_dest->offset > orig_insn->offset))
> -		    break;
> -
>  		table_reloc = arch_find_switch_table(file, insn, is_rel);
>  		if (!table_reloc)
>  			continue;
> -- 
> 2.40.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ