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: <ZB3laWS5+X13nhvi@FVFF77S0Q05N>
Date:   Fri, 24 Mar 2023 18:01:13 +0000
From:   Mark Rutland <mark.rutland@....com>
To:     Florent Revest <revest@...omium.org>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-trace-kernel@...r.kernel.org, bpf@...r.kernel.org,
        catalin.marinas@....com, will@...nel.org, rostedt@...dmis.org,
        mhiramat@...nel.org, ast@...nel.org, daniel@...earbox.net,
        andrii@...nel.org, kpsingh@...nel.org, jolsa@...nel.org,
        xukuohai@...weicloud.com, lihuafei1@...wei.com
Subject: Re: [PATCH v3 2/4] arm64: ftrace: Simplify get_ftrace_plt

On Fri, Mar 24, 2023 at 06:14:49PM +0100, Florent Revest wrote:
> Following recent refactorings, the get_ftrace_plt function only ever
> gets called with addr = FTRACE_ADDR so its code can be simplified to
> always return the ftrace trampoline plt.
> 
> Signed-off-by: Florent Revest <revest@...omium.org>

Acked-by: Mark Rutland <mark.rutland@....com>

Mark.

> ---
>  arch/arm64/kernel/ftrace.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c
> index 758436727fba..432626c866a8 100644
> --- a/arch/arm64/kernel/ftrace.c
> +++ b/arch/arm64/kernel/ftrace.c
> @@ -195,15 +195,15 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
>  	return ftrace_modify_code(pc, 0, new, false);
>  }
>  
> -static struct plt_entry *get_ftrace_plt(struct module *mod, unsigned long addr)
> +static struct plt_entry *get_ftrace_plt(struct module *mod)
>  {
>  #ifdef CONFIG_ARM64_MODULE_PLTS
>  	struct plt_entry *plt = mod->arch.ftrace_trampolines;
>  
> -	if (addr == FTRACE_ADDR)
> -		return &plt[FTRACE_PLT_IDX];
> -#endif
> +	return &plt[FTRACE_PLT_IDX];
> +#else
>  	return NULL;
> +#endif
>  }
>  
>  static bool reachable_by_bl(unsigned long addr, unsigned long pc)
> @@ -270,7 +270,7 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec,
>  	if (WARN_ON(!mod))
>  		return false;
>  
> -	plt = get_ftrace_plt(mod, *addr);
> +	plt = get_ftrace_plt(mod);
>  	if (!plt) {
>  		pr_err("ftrace: no module PLT for %ps\n", (void *)*addr);
>  		return false;
> -- 
> 2.40.0.348.gf938b09366-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ