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] [day] [month] [year] [list]
Date:   Wed, 20 Oct 2021 10:30:37 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     x86@...nel.org, andrew.cooper3@...rix.com,
        linux-kernel@...r.kernel.org, alexei.starovoitov@...il.com,
        ndesaulniers@...gle.com
Subject: Re: [PATCH 4/9] x86/alternative: Implement .retpoline_sites support

On Tue, Oct 19, 2021 at 09:49:13AM -0700, Josh Poimboeuf wrote:

> @@ -1087,9 +1109,7 @@ static int add_jump_destinations(struct objtool_file *file)
>  			else
>  				insn->type = INSN_JUMP_DYNAMIC_CONDITIONAL;
>  
> -			list_add_tail(&insn->call_node,
> -				      &file->retpoline_call_list);
> -
> +			add_call_dest(file, insn, reloc->sym, true);
>  			insn->retpoline_safe = true;
>  			continue;
>  		} else if (insn->func) {
> @@ -1218,20 +1238,14 @@ static int add_call_destinations(struct objtool_file *file)
>  
>  			add_call_dest(file, insn, dest, false);
>  
> -		} else if (arch_is_retpoline(reloc->sym)) {
> +		} else if (reloc->sym->retpoline) {
>  			/*
>  			 * Retpoline calls are really dynamic calls in
>  			 * disguise, so convert them accordingly.
>  			 */
>  			insn->type = INSN_CALL_DYNAMIC;
> +			add_call_dest(file, insn, reloc->sym, false);
>  			insn->retpoline_safe = true;
> -
> -			list_add_tail(&insn->call_node,
> -				      &file->retpoline_call_list);
> -
> -			remove_insn_ops(insn);
> -			continue;
> -
>  		} else
>  			add_call_dest(file, insn, reloc->sym, false);
>  	}

So the problem with add_call_dest() like this, is that the instructions
now get to have ->call_dest set, which is really strange for
INSN_CALL_DYNAMIC etc.. At the very least it makes call_dest_name()
misbehave.

I've added add_retpoline_call() that also does the ->type frobbing and
->retpoline_safe marking instead.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ