Re: [RFC PATCH 2/4] rseq: Allow extending struct rseq

From: Florian Weimer
Date: Tue Jul 14 2020 - 05:58:40 EST


* Mathieu Desnoyers:

> + /*
> + * Very last field of the structure, to calculate size excluding padding
> + * with offsetof().
> + */
> + char end[];
> } __attribute__((aligned(4 * sizeof(__u64))));

This makes the header incompatible with standard C++.

How are extensions going to affect the definition of struct rseq,
including its alignment?

As things stand now, glibc 2.32 will make the size and alignment of
struct rseq part of its ABI, so it can't really change after that.

With a different approach, we can avoid making the symbol size part of
the ABI, but then we cannot use the __rseq_abi TLS symbol. As a result,
interoperability with early adopters would be lost.

One way to avoid this problem would be for every library to register its
own rseq area, of the appropriate size. Then process-wide coordination
in userspace would not be needed.

Thanks,
Florian