lkml.org 
[lkml]   [2016]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 08/10] x86/xsaves: Fix PTRACE frames for XSAVES
From
Date
On 02/22/2016 11:00 AM, Yu-cheng Yu wrote:
> + if (xsave->header.xfeatures & XFEATURE_MASK_SUPERVISOR)
> + xsave->header.xfeatures = xfeatures | XFEATURE_MASK_SUPERVISOR;
> + else
> + xsave->header.xfeatures = xfeatures;

This is dangerous. It says, "if any supervisor feature bit is set, then
set *ALL* of the known bits". There's no way that can work.

Don't you just want to or in the new bits that were in the passed-in
'xfeatures':

xsave->header.xfeatures |= xfeatures;

'xfeatures' is known not to contain any supervisor bits.

\
 
 \ /
  Last update: 2016-02-22 21:21    [W:0.052 / U:1.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site