rseq notes from Cauldron

Florian Weimer fw@deneb.enyo.de
Fri Dec 20 19:43:00 GMT 2019


* Mathieu Desnoyers:

>> rseq.h already says this:
>> 
>>         * […] Also needs to be set to NULL by user-space
>>         * before reclaiming memory that contains the targeted struct rseq_cs.
>> 
>> With dlclose, the struct rseq_cs will likely be gone, not just the
>> code, so I think in practice, it's already necessary to clear rseq_cs
>> in userspace.  For completeness, the UAPI header should mention that
>> this applies to the text region described by struct rseq_cs as well.
>
> Actually, it only applies to the struct rseq_cs per se. The kernel
> does not need to access the text region described by struct rseq_cs.
> It only uses the start_ip and post_commit_offset fields to figure out
> if it is indeed preempting a rseq critical section. It does not need
> to access the memory contents at those addresses. So I don't think
> any change to the UAPI comment is needed.

But the unmapping and remapping issue for the text segment is a real
problem.  There is a semantic dependency here.



More information about the Libc-alpha mailing list