[RFC PATCH glibc] Linux: Use fixed rseq_len value for rseq registration

Mathieu Desnoyers mathieu.desnoyers@efficios.com
Tue Jul 14 14:04:05 GMT 2020


----- On Jul 14, 2020, at 9:54 AM, Florian Weimer fweimer@redhat.com wrote:

> * Christian Brauner:
> 
>>> It works reliably as long as glibc only ever uses the minimum rseq size.
>>> And since glibc monopolizes the rseq registration, applications cannot
>>> register a larger area.  So there is no way to make use of any future
>>> kernel extensions.
>>
>> But when you bump ABI in glibc you can switch to a new rseq size, no?
> 
> We are expected to support interposers with their own definition
> __rseq_abi, which could be smaller.

In this scenario, the interposers would have to follow the UAPI rules:
The size should at least cover the original struct rseq fields,
up to and including the flags field.

This just means glibc would internally abide by the same rules as the
other users if it want to use an extended rseq structure, and not expect
to be the only possible library defining the __rseq_abi symbol. If glibc
wants to use the extension feature, it would have to validate that the
RSEQ_TLS_FLAG_SIZE flag is set in the __rseq_abi.flags, and then validate
that __rseq_abi.kernel_size covers the feature it needs before accessing
the feature field.

It would have to do something similar anyway to make sure the kernel
supports those extensions.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the Libc-alpha mailing list