Skip to content

Forget the cached per-CPU slab address when a thread unregisters from rseq. - #1895

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1007036919
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1007036919

Conversation

@copybara-service

Copy link
Copy Markdown

Forget the cached per-CPU slab address when a thread unregisters from rseq.

A thread's cached slab address is invalidated by the kernel: every reschedule
rewrites __rseq_abi, whose bytes overlap the cached address. Once the thread
unregisters from rseq the kernel stops doing so, and a fast path that found the
address still cached would run its no longer restartable sequence against that
CPU's slab from wherever the thread now executes.

Have tcmalloc::UnregisterRseq() drop the cached address after the syscall.

… rseq.

A thread's cached slab address is invalidated by the kernel: every reschedule
rewrites __rseq_abi, whose bytes overlap the cached address. Once the thread
unregisters from rseq the kernel stops doing so, and a fast path that found the
address still cached would run its no longer restartable sequence against that
CPU's slab from wherever the thread now executes.

Have tcmalloc::UnregisterRseq() drop the cached address after the syscall.

PiperOrigin-RevId: 1007036919

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant