lkml.org 
[lkml]   [2020]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Random shadow stack pointer corruption
On Sat, Jul 18, 2020 at 3:41 PM Dave Hansen <dave.hansen@intel.com> wrote:
>
> On 7/18/20 11:24 AM, Yu-cheng Yu wrote:
> > On Sat, 2020-07-18 at 11:00 -0700, Andy Lutomirski wrote:
> >> On Sat, Jul 18, 2020 at 10:58 AM Yu-cheng Yu <yu-cheng.yu@intel.com> wrote:
> >>> Hi,
> >>>
> >>> My shadow stack tests start to have random shadow stack pointer corruption after
> >>> v5.7 (excluding). The symptom looks like some locking issue or the kernel is
> >>> confused about which CPU a task is on. In later tip/master, this can be
> >>> triggered by creating two tasks and each does continuous
> >>> pthread_create()/pthread_join(). If the kernel has max_cpus=1, the issue goes
> >>> away. I also checked XSAVES/XRSTORS, but this does not seem to be an issue
> >>> coming from there.
> >>
> >> What do you mean "shadow stack pointer corruption"? Is SSP itself
> >> corrupt while running in the kernel? Is one of the MSRs getting
> >> corrupted? Is the memory to which the shadow stack points getting
> >> corrupted? Is the CPU rejecting an attempt to change SSP?
> >
> > What I see is, a new thread after ret_from_fork() and iret back to ring-3,
> > its shadow stack pointer (MSR_IA32_PL3_SSP) is corrupted.
>
> Does corrupt mean random? Or is it a valid stack address, just not for
> _this_ thread? Or NULL? Or is it a kernel address? Have you tried
> tracing *ALL* the WRMSR's and XRSTOR's that write to the MSR?

Another data point. When memory corruption happened, there was no
core dump at all. We verified that core dump was enabled and we did
get core dump for other programs.


--
H.J.

\
 
 \ /
  Last update: 2020-07-19 01:07    [W:0.132 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site