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: <2cd7b099-095d-405c-a7d9-b0f1f72184c2@orca.pet>
Date: Wed, 20 Aug 2025 11:33:05 +0200
From: Marcos Del Sol Vives <marcos@...a.pet>
To: "Ahmed S. Darwish" <darwi@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
 Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
 Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
 "H. Peter Anvin" <hpa@...or.com>, Brian Gerst <brgerst@...il.com>,
 Uros Bizjak <ubizjak@...il.com>, Ard Biesheuvel <ardb@...nel.org>,
 David Kaplan <david.kaplan@....com>, Kees Cook <kees@...nel.org>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>,
 Andrew Cooper <andrew.cooper3@...rix.com>, Oleg Nesterov <oleg@...hat.com>,
 "Xin Li (Intel)" <xin@...or.com>, Sabyrzhan Tasbolatov <snovitoll@...il.com>
Subject: Re: [PATCH] x86: add hintable NOPs emulation

Hi Ahmed,

El 20/08/2025 a las 11:14, Ahmed S. Darwish escribió:
> Can we please remove all this 'hnop_warn' trickery?  Removing it will
> simplifiy the code and avoid complicating 'thread_struct' further.
> 
> It's just the kernel doing its normal job.
> 
> And if the system is full of binaries with hintable NOPs, ratelimiting
> will not save you much.  I got hit recently by a 'ratelimited'
> correctible error PCI subsystem warning, and it still overflows the log
> buffers of my Thinkpad laptop, in just 4 to 5 days :(

But I think the kernel should let the user know the binaries they're
running are having some performance penalty due to this emulation, in case
they want to recompile without the offending flags.

Without the logging, they'd be in the dark and might get confused on why
their programs are running slower than on other machines.

>>
>> static inline void handle_invalid_op(struct pt_regs *regs)
>> {
>> +#ifdef CONFIG_X86_HNOP_EMU
>> +	if (user_mode(regs) && handle_hnop(regs))
>> +		return;
>> +#endif
>> +
>>
> 
> CPP conditionals within C function code are ugly.  Please do instead:
> 
>     static bool handle_hnop(struct pt_regs *regs)
>     {
> 	if (!IS_ENABLED(CONFIG_X86_HNOP_EMU))
> 		return false;
> 	...
>     }
> 
> Thanks for your contribution!

I originally did that, but then realized it was not possible due to
"handle_hnop" depending on the conditionally-available "hnop_warn" flag.

Greetings,
Marcos

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ