This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: V2: [PATCH 01/24] x86: Rename __glibc_reserved1 to feature_1 in tcbhead_t [BZ #22563]
* Jeff Law:
> On 07/13/2018 01:05 PM, Carlos O'Donell wrote:
>> I think the sanitizers are not within their rights to use any bytes in the
>> tcbhead_t structure, particularly reserved bytes. We should coordinate with
>> them, but that should not stop the acceptance of this patch in 2.28.
> sanitizer_common/sanitizer_linux.cc:
>
> static bool Aarch64GetESR(ucontext_t *ucontext, u64 *esr) {
> static const u32 kEsrMagic = 0x45535201;
> u8 *aux = ucontext->uc_mcontext.__reserved;
> while (true) {
> _aarch64_ctx *ctx = (_aarch64_ctx *)aux;
> if (ctx->size == 0) break;
> if (ctx->magic == kEsrMagic) {
> *esr = ((__sanitizer_esr_context *)ctx)->esr;
> return true;
> }
> aux += ctx->size;
> }
> return false;
> }
>
> It's seriously lame that they're abusing the reserved field like that...
In this case, __reserved doesn't mean “reserved for future use”, but
“reserved as an allocation area for the kernel for dynamically sized
data structures”. This is part of the kernel/userspace API.