Re: [PATCH] x86, fpu: fix 32-bit signal frame handling

From: Dave Hansen
Date: Thu Nov 12 2015 - 17:51:38 EST


On 11/10/2015 04:23 PM, Dave Hansen wrote:
> For MPX, this leads to the most permissive state and means we
> silently lose bounds violations. I think this would also mean
> that we could lose *ANY* FPU/SSE/AVX state. I'm not sure why
> no one has spotted this bug.

FWIW, I looked at this a little more today.

We lose all extended state for our "extended xfeatures", also known as
state component numbers >=2 (AVX, MPX, AVX-512, PKEYs)... But we retain
the state for FP/SSE state. So we lose the top half of the AVX
registers (the bottom half are SSE state).

I also did a little objdump'ing and grep'ing in a 32-bit distro.
There's no sign of actual use of the ymm registers.

Basically, it appears nobody has taken a 64-bit Sandybridge or later
CPU, put a 32-bit distro on it that had a >=3.7 kernel on it and tried
to use AVX instructions. Or, if they did, they got random corruption
and gave up before actually diagnosing the problem. :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/