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]
Message-ID: <15e31e59-3429-53f8-bb61-5f60c90fa856@huawei.com>
Date:   Fri, 8 May 2020 09:29:13 +0800
From:   Yunfeng Ye <yeyunfeng@...wei.com>
To:     Will Deacon <will@...nel.org>
CC:     <catalin.marinas@....com>, <Dave.Martin@....com>,
        <mark.rutland@....com>, <james.morse@....com>,
        <0x7f454c46@...il.com>, <tglx@...utronix.de>,
        <lorenzo.pieralisi@....com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <hushiyuan@...wei.com>,
        <hewenliang4@...wei.com>
Subject: Re: [PATCH] arm64: stacktrace: Factor out some common code info
 on_stack()



On 2020/5/7 21:52, Will Deacon wrote:
> On Thu, May 07, 2020 at 05:28:19PM +0800, Yunfeng Ye wrote:
>> diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h
>> index fdb913cc0bcb..b92bef2fb6cd 100644
>> --- a/arch/arm64/include/asm/stacktrace.h
>> +++ b/arch/arm64/include/asm/stacktrace.h
>> @@ -69,27 +69,40 @@ extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
>>
>>  DECLARE_PER_CPU(unsigned long *, irq_stack_ptr);
>>
>> -static inline bool on_irq_stack(unsigned long sp,
>> +static inline bool on_stack(unsigned long sp, unsigned long low,
>> +				unsigned long high, enum stack_type type,
>>  				struct stack_info *info)
>>  {
>> -	unsigned long low = (unsigned long)raw_cpu_read(irq_stack_ptr);
>> -	unsigned long high = low + IRQ_STACK_SIZE;
>> -
>> -	if (!low)
>> -		return false;
>> -
>>  	if (sp < low || sp >= high)
>>  		return false;
>>
>>  	if (info) {
>>  		info->low = low;
>>  		info->high = high;
>> -		info->type = STACK_TYPE_IRQ;
>> +		info->type = type;
>>  	}
>> -
>>  	return true;
>>  }
>>
>> +static inline bool on_valid_stack(unsigned long sp, unsigned long low,
>> +				unsigned long high, enum stack_type type,
>> +				struct stack_info *info)
>> +{
>> +	if (!low)
>> +		return false;
>> +
>> +	return on_stack(sp, low, high, type, info);
>> +}
> 
> Do we need this as distinct from on_stack()? Afaict, 'low' is never
> going to be NULL for the on_stack() callers, so I suggest just having
> on_stack() check 'low' and getting everybody to call that instead.
> 
> Make sense?
> 
ok, I will modify and send the patch v2, thanks.

> Will
> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ