[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d78f0c7c-a672-2a74-974f-dffc67833abc@intel.com>
Date: Tue, 1 Sep 2020 11:24:16 -0700
From: "Yu, Yu-cheng" <yu-cheng.yu@...el.com>
To: Florian Weimer <fweimer@...hat.com>
Cc: "H.J. Lu" <hjl.tools@...il.com>, Dave Martin <Dave.Martin@....com>,
Dave Hansen <dave.hansen@...el.com>,
Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>,
linux-arch <linux-arch@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
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>,
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>,
Weijiang Yang <weijiang.yang@...el.com>
Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for
shadow stack
On 9/1/2020 11:17 AM, Florian Weimer wrote:
> * Yu-cheng Yu:
>
>> On 9/1/2020 10:50 AM, Florian Weimer wrote:
>>> * Yu-cheng Yu:
>>>
>>>> Like other arch_prctl()'s, this parameter was 'unsigned long'
>>>> earlier. The idea was, since this arch_prctl is only implemented for
>>>> the 64-bit kernel, we wanted it to look as 64-bit only. I will change
>>>> it back to 'unsigned long'.
>>> What about x32? In general, long is rather problematic for x32.
>>
>> The problem is the size of 'long', right?
>> Because this parameter is passed in a register, and only the lower
>> bits are used, x32 works as well.
>
> The userspace calling convention leaves the upper 32-bit undefined.
> Therefore, this only works by accident if the kernel does not check that
> the upper 32-bit are zero, which is probably a kernel bug.
>
> It's unclear to me what you are trying to accomplish. Why do you want
> to use unsigned long here? The correct type appears to be unsigned int.
> This correctly expresses that the upper 32 bits of the register do not
> matter.
Yes, you are right. I will make it 'unsigned int'.
Thanks,
Yu-cheng
Powered by blists - more mailing lists