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: <31c8dabc-185d-be7b-c800-30a7ff29b34e@intel.com>
Date:   Mon, 30 Nov 2020 10:12:53 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     "Yu, Yu-cheng" <yu-cheng.yu@...el.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-mm@...ck.org,
        linux-arch@...r.kernel.org, linux-api@...r.kernel.org,
        Arnd Bergmann <arnd@...db.de>,
        Andy Lutomirski <luto@...nel.org>,
        Balbir Singh <bsingharora@...il.com>,
        Borislav Petkov <bp@...en8.de>,
        Cyrill Gorcunov <gorcunov@...il.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Eugene Syromiatnikov <esyr@...hat.com>,
        Florian Weimer <fweimer@...hat.com>,
        "H.J. Lu" <hjl.tools@...il.com>, Jann Horn <jannh@...gle.com>,
        Jonathan Corbet <corbet@....net>,
        Kees Cook <keescook@...omium.org>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Nadav Amit <nadav.amit@...il.com>,
        Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
        Peter Zijlstra <peterz@...radead.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        "Ravi V. Shankar" <ravi.v.shankar@...el.com>,
        Vedvyas Shanbhogue <vedvyas.shanbhogue@...el.com>,
        Dave Martin <Dave.Martin@....com>,
        Weijiang Yang <weijiang.yang@...el.com>,
        Pengfei Xu <pengfei.xu@...el.com>
Subject: Re: [NEEDS-REVIEW] [PATCH v15 03/26] x86/fpu/xstate: Introduce CET
 MSR XSAVES supervisor states

On 11/30/20 10:06 AM, Yu, Yu-cheng wrote:
>>> +            if (!boot_cpu_has(X86_FEATURE_SHSTK) &&
>>> +                !boot_cpu_has(X86_FEATURE_IBT))
>>> +                xfeatures_mask_all &= ~BIT_ULL(i);
>>> +        } else {
>>> +            if ((xsave_cpuid_features[i] == -1) ||
>>
>> Where did the -1 come from?  Was that introduced earlier in this series?
>>   I don't see any way a xsave_cpuid_features[] can be -1 in the
>> current tree.
> 
> Yes, we used to have a hole in xsave_cpuid_features[] and put -1 there.
> Do we want to keep this in case we again have holes in the future?

So, it's dead code for the moment and it's impossible to tell what -1
means without looking at git history?  That seems, um, suboptimal.

Shouldn't we have:

#define XFEATURE_NO_DEP -1

?

And then this code becomes:

	if ((xsave_cpuid_features[i] == XFEATURE_NO_DEP))
		// skip it...

We can even put a comment in xsave_cpuid_features[] to tell folks to use
it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ