This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb/x86: Fix write out of mxcsr register for xsave targets
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Fri, 11 May 2018 18:14:20 +0100
- Subject: Re: [PATCH] gdb/x86: Fix write out of mxcsr register for xsave targets
- References: <20180511115228.22098-1-andrew.burgess@embecosm.com>
On 05/11/2018 12:52 PM, Andrew Burgess wrote:
> In commit:
>
> commit 8ee22052f690c007556b97eed59f49350ece5ca9
> Author: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Thu May 3 17:46:14 2018 +0100
>
> gdb/x86: Handle kernels using compact xsave format
>
> in two places FXSAVE_ADDR was used instead of FXSAVE_MXCSR_ADDR to get
> the address of the mxcsr register within the xsave buffer. This will
> mean we are potentially accessing the wrong location within the xsave
> buffer.
>
> There are no tests included with this patch. The first mistake would
> only trigger an issue if/when the user tries to manually set the mxcsr
> register to a value that matches the random (value off stack) value
> that is in the xsave buffer, in this case the change by the user will
> go unnoticed by GDB, and the default value of mxcsr will be preserved.
>
> The second mistake only happens on the code path where all x87
> registers are being written out of the register cache. I'm not sure
> how to trigger that code path.
>
OK as is.
How did you notice this? Valgrind?
Thanks,
Pedro Alves