Re: [PATCH v5 00/12] Add CET shadow stack support

Luis Machado
2025-07-28T17:07:24Z

Hi Christina,

Sorry, only spotted this now.

On 7/23/25 13:45, Schimpe, Christina wrote:
> Hi Luis,
>
> I finally also tested x32 and it looks good, there was only one issue
> with the new coredump test due to RDSSPD/RDSSPQ instructions
> for reading the shadow stack pointer:
> amd64-shadow-stack-corefile.c:26: Error: operand size mismatch for `rdsspq'
>
> So I have to adapt the instruction for x32 to "rdsspd " to copy low 32 bits only.
>
> I suggest to fix the testfile as follows:
> ~~~
> diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.c b/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.c
> index f078e33810d..5e84793ccb1 100644
> --- a/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.c
> +++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.c
> @@ -23,7 +23,11 @@ void
> function ()
> {
> unsigned long ssp;
> - asm volatile("xor %0, %0; rdsspq %0" : "=r" (ssp));
> + #ifndef __ILP32__
> + asm volatile ("xor %0, %0; rdsspq %0" : "=r" (ssp));
> + #else
> + asm volatile ("xor %0, %0; rdsspd %0" : "=r" (ssp));
> + #endif
> ~~~
>
> Would that be fine ore should I repost the patch?
>
> Other than that I'll retest again with latest upstream master and push this tomorrow.
>

That's fine by me. I see Andrew had some comments on your series. Are those addressed locally now or are you still working on them?