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: <9db3f9f3-8fc0-9f33-2c93-7d51006dc127@csgroup.eu>
Date:   Tue, 30 Aug 2022 06:36:05 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Sathvika Vasireddy <sv@...ux.ibm.com>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
CC:     "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "aik@...abs.ru" <aik@...abs.ru>,
        "mpe@...erman.id.au" <mpe@...erman.id.au>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "mbenes@...e.cz" <mbenes@...e.cz>,
        "npiggin@...il.com" <npiggin@...il.com>,
        "chenzhongjin@...wei.com" <chenzhongjin@...wei.com>,
        "naveen.n.rao@...ux.vnet.ibm.com" <naveen.n.rao@...ux.vnet.ibm.com>
Subject: Re: [PATCH v2 14/16] objtool: Add arch specific function
 arch_ftrace_match()



Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
> Add architecture specific function to look for
> relocation records pointing to arch specific
> symbols.
> 
> Suggested-by: Christophe Leroy <christophe.leroy@...roup.eu>
> Signed-off-by: Sathvika Vasireddy <sv@...ux.ibm.com>

Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>

> ---
>   tools/objtool/arch/x86/decode.c      | 8 ++++++++
>   tools/objtool/check.c                | 2 +-
>   tools/objtool/include/objtool/arch.h | 2 ++
>   3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
> index c260006106be..025598b6b703 100644
> --- a/tools/objtool/arch/x86/decode.c
> +++ b/tools/objtool/arch/x86/decode.c
> @@ -23,6 +23,14 @@
>   #include <objtool/builtin.h>
>   #include <arch/elf.h>
>   
> +bool arch_ftrace_match(char *name)
> +{
> +	if (!strcmp(name, "__fentry__"))
> +		return true;
> +
> +	return false;

Could be simplified as:

	return !strcmp(name, "__fentry__");


Whatever:

Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>



> +}
> +
>   static int is_x86_64(const struct elf *elf)
>   {
>   	switch (elf->ehdr.e_machine) {
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index f1d055467926..01ff7504f18d 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -2294,7 +2294,7 @@ static int classify_symbols(struct objtool_file *file)
>   			if (arch_is_rethunk(func))
>   				func->return_thunk = true;
>   
> -			if (!strcmp(func->name, "__fentry__"))
> +			if (arch_ftrace_match(func->name))
>   				func->fentry = true;
>   
>   			if (is_profiling_func(func->name))
> diff --git a/tools/objtool/include/objtool/arch.h b/tools/objtool/include/objtool/arch.h
> index beb2f3aa94ff..2ba4b9897285 100644
> --- a/tools/objtool/include/objtool/arch.h
> +++ b/tools/objtool/include/objtool/arch.h
> @@ -69,6 +69,8 @@ struct stack_op {
>   
>   struct instruction;
>   
> +bool arch_ftrace_match(char *name);
> +
>   void arch_initial_func_cfi_state(struct cfi_init_state *state);
>   
>   int arch_decode_instruction(struct objtool_file *file, const struct section *sec,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ