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]
Date:   Thu, 31 Mar 2022 00:32:41 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Dave Hansen <dave.hansen@...el.com>
Cc:     Neil Armstrong <narmstrong@...libre.com>, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
        x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: undef REG_IN/REG_OUT to avoid define collisions

On Wed, Mar 30 2022 at 18:54, Andy Shevchenko wrote:
> On Wed, Mar 30, 2022 at 08:33:26AM -0700, Dave Hansen wrote:
>> On 3/30/22 08:28, Neil Armstrong wrote:
>> > diff --git a/arch/x86/include/asm/arch_hweight.h b/arch/x86/include/asm/arch_hweight.h
>> > index ba88edd0d58b..139a4b0a2a14 100644
>> > --- a/arch/x86/include/asm/arch_hweight.h
>> > +++ b/arch/x86/include/asm/arch_hweight.h
>> > @@ -52,4 +52,7 @@ static __always_inline unsigned long __arch_hweight64(__u64 w)
>> >  }
>> >  #endif /* CONFIG_X86_32 */
>> >  
>> > +#undef REG_IN
>> > +#undef REG_OUT
>> 
>> Wouldn't it be a bit less hackish to give these a more qualified name
>> like HWEIGHT_REG_IN?

Absolutely.

> Either way, would it be good to undef them here anyway?

No. Unconditional #undef is a guarantee for hard to diagnose trouble
because it papers over namespace collisions. You can end up with the
wrong constants in your binary which might work well except for the once
in the blue moon corner case.

Been there and stared at such nonsense for weeks...

Name spaces exist for a reason and we are not short of characters here.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ