Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack
From: Yu, Yu-cheng <hidden>
Date: 2020-09-01 17:49:11
Also in:
linux-api, linux-arch, linux-mm, lkml
From: Yu, Yu-cheng <hidden>
Date: 2020-09-01 17:49:11
Also in:
linux-api, linux-arch, linux-mm, lkml
On 8/27/2020 7:08 AM, H.J. Lu wrote:
On Thu, Aug 27, 2020 at 7:07 AM H.J. Lu [off-list ref] wrote:quoted
On Thu, Aug 27, 2020 at 6:36 AM Florian Weimer [off-list ref] wrote:quoted
* H. J. Lu:quoted
On Thu, Aug 27, 2020 at 6:19 AM Florian Weimer [off-list ref] wrote:quoted
* Dave Martin:quoted
You're right that this has implications: for i386, libc probably pulls more arguments off the stack than are really there in some situations. This isn't a new problem though. There are already generic prctls with fewer than 4 args that are used on x86.As originally posted, glibc prctl would have to know that it has to pull an u64 argument off the argument list for ARCH_X86_CET_DISABLE. But then the u64 argument is a problem for arch_prctl as well.Argument of ARCH_X86_CET_DISABLE is int and passed in register.The commit message and the C source say otherwise, I think (not sure about the C source, not a kernel hacker).It should read: arch_prctl(ARCH_X86_CET_DISABLE, unsigned long features)Or arch_prctl(ARCH_X86_CET_DISABLE, unsigned int features)
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'. Yu-cheng