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, 29 Aug 2023 16:33:14 +0800
From:   Jinyang He <hejinyang@...ngson.cn>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>,
        Huacai Chen <chenhuacai@...nel.org>
Cc:     loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
        loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH] LoongArch: Define the symbol fault as a local label in
 fpu.S

On 2023-08-29 14:28, Tiezhu Yang wrote:

> The initial aim is to silence the following objtool warnings:
>
>    arch/loongarch/kernel/fpu.o: warning: objtool: _save_fp_context() falls through to next function fault()
>    arch/loongarch/kernel/fpu.o: warning: objtool: _restore_fp_context() falls through to next function fault()
>    arch/loongarch/kernel/fpu.o: warning: objtool: _save_lsx_context() falls through to next function fault()
>    arch/loongarch/kernel/fpu.o: warning: objtool: _restore_lsx_context() falls through to next function fault()
>    arch/loongarch/kernel/fpu.o: warning: objtool: _save_lasx_context() falls through to next function fault()
>    arch/loongarch/kernel/fpu.o: warning: objtool: _restore_lasx_context() falls through to next function fault()
>
> Obviously, the symbol fault is not a function, it is just a local label,
> so use SYM_CODE_START_LOCAL and SYM_CODE_END to define the symbol fault.
>
> Before:
>
> $ readelf -s arch/loongarch/kernel/fpu.o | awk -F: /fault/'{print $2}'
>   000000000000053c     8 FUNC    GLOBAL DEFAULT    1 fault
>
> After:
>
> $ readelf -s arch/loongarch/kernel/fpu.o | awk -F: /fault/'{print $2}'
>   000000000000053c     8 NOTYPE  LOCAL  DEFAULT    1 fault
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> ---
>   arch/loongarch/kernel/fpu.S | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/loongarch/kernel/fpu.S b/arch/loongarch/kernel/fpu.S
> index b4032de..7defe50 100644
> --- a/arch/loongarch/kernel/fpu.S
> +++ b/arch/loongarch/kernel/fpu.S
> @@ -521,7 +521,7 @@ SYM_FUNC_START(_restore_lasx_context)
>   	jr	ra
>   SYM_FUNC_END(_restore_lasx_context)
>   
> -SYM_FUNC_START(fault)
> +SYM_CODE_START_LOCAL(fault)


Hi, Tiezhu,

The include/linux/linkage.h noted,
  * FUNC -- C-like functions (proper stack frame etc.)
  * CODE -- non-C code (e.g. irq handlers with different, special stack 
etc.)
I think here should be SYM_FUNC_START_LOCAL. Thus, it may create debug
info like sp_offset == 0 && ra == CFI_UNDEFINED, (just some impressions).

BTW, I've noticed some funcs should be marked as SYM_CODE.., e.g.
handle_syscall, handle_tlb_xxx. If you are sure that changes are
necessary, fix them.

Thanks!

Jinyang


>   	li.w	a0, -EFAULT				# failure
>   	jr	ra
> -SYM_FUNC_END(fault)
> +SYM_CODE_END(fault)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ