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: <21071aac-8eaf-cfd7-6211-d119b257ef4c@huawei.com>
Date: Tue, 25 Nov 2025 11:23:04 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: Kevin Brodsky <kevin.brodsky@....com>, <catalin.marinas@....com>,
	<will@...nel.org>, <oleg@...hat.com>, <tglx@...utronix.de>,
	<peterz@...radead.org>, <luto@...nel.org>, <shuah@...nel.org>,
	<kees@...nel.org>, <wad@...omium.org>, <akpm@...ux-foundation.org>,
	<ldv@...ace.io>, <macro@...am.me.uk>, <deller@....de>,
	<mark.rutland@....com>, <song@...nel.org>, <mbenes@...e.cz>,
	<ryan.roberts@....com>, <ada.coupriediaz@....com>,
	<anshuman.khandual@....com>, <broonie@...nel.org>, <pengcan@...inos.cn>,
	<dvyukov@...gle.com>, <kmal@...k.li>, <lihongbo22@...wei.com>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	<linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH v7 09/11] entry: Add has_syscall_work() helper



On 2025/11/19 1:13, Kevin Brodsky wrote:
> On 17/11/2025 14:30, Jinjie Ruan wrote:
>> Add has_syscall_work() helper to facilitate reuse of this
>> function in other places.
>>
>> No functional changes.
>>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
>> ---
>>  include/linux/entry-common.h | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
>> index cd6dacb2d8bf..e0f94e937e84 100644
>> --- a/include/linux/entry-common.h
>> +++ b/include/linux/entry-common.h
>> @@ -44,6 +44,11 @@
>>  				 SYSCALL_WORK_SYSCALL_EXIT_TRAP	|	\
>>  				 ARCH_SYSCALL_WORK_EXIT)
>>  
>> +static inline bool has_syscall_work(unsigned long work)
>> +{
>> +	return unlikely(work & SYSCALL_WORK_ENTER);
> 
> I'm not sure this is a good idea, since the generic syscall machinery
> has two separate sets of flags (SYSCALL_WORK_ENTER and
> SYSCALL_WORK_EXIT). Of course we could reflect that in the helper's
> name, but since it's only used twice after patch 10, maybe we don't need
> a helper at all.

Will remove it.

> 
> - Kevin
> 
>> +}
>> +
>>  /**
>>   * syscall_enter_from_user_mode_prepare - Establish state and enable interrupts
>>   * @regs:	Pointer to currents pt_regs
>> @@ -91,7 +96,7 @@ static __always_inline long syscall_enter_from_user_mode_work(struct pt_regs *re
>>  {
>>  	unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
>>  
>> -	if (work & SYSCALL_WORK_ENTER)
>> +	if (has_syscall_work(work))
>>  		syscall = syscall_trace_enter(regs, syscall, work);
>>  
>>  	return syscall;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ