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: <6b65d5c4-f648-7a84-bba0-d25e6a9091b6@loongson.cn>
Date:   Tue, 29 Aug 2023 16:46:18 +0800
From:   Jinyang He <hejinyang@...ngson.cn>
To:     Xi Ruoyao <xry111@...111.site>,
        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:45, Xi Ruoyao wrote:

> On Tue, 2023-08-29 at 14:28 +0800, 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,
> Hmm why?  To me this seems a function.  We don't branch to it but store
> its address (a "function pointer") in the extable.
>
> And these warnings do not make any sense to me:
>
> /* snip */
>
>> 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
> _restore_lasx_context returns with this instruction.  How can it fall
> through into fault?

I think it is because objtool will check ex_table. Something special 
here. (in special.c)

So this function control flow reaches another global function, caused 
warning. (Just some impressions)


Thanks,

Jinyang

>
>>   SYM_FUNC_END(_restore_lasx_context)
>> -SYM_FUNC_START(fault)
>> +SYM_CODE_START_LOCAL(fault)
>>          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