<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/rust/kernel/sync/srcu.rs, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/rust/kernel/sync/srcu.rs?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/rust/kernel/sync/srcu.rs?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-07-15T22:34:26Z</updated>
<entry>
<title>rust: sync: add SRCU abstraction</title>
<updated>2026-07-15T22:34:26Z</updated>
<author>
<name>Onur Özkan</name>
<email>work@onurozkan.dev</email>
</author>
<published>2026-06-13T06:40:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=59cf3a5bda61cd3c300f0db952afcb031806e802'/>
<id>urn:sha1:59cf3a5bda61cd3c300f0db952afcb031806e802</id>
<content type='text'>
Add a Rust abstraction for sleepable RCU (SRCU), backed by C srcu_struct.
Provide FFI helpers and a safe wrapper with a guard-based API for read-side
critical sections.

Cleanup is handled via `PinnedDrop`. It first checks for active read-side
sections and emits a warning if any guards were leaked. In that case, it
waits in `synchronize_srcu()` rather than risking a UAF by freeing the
`srcu_struct` that is still reachable from the C side. It then uses
`srcu_barrier()` to drain pending callbacks before finally calling
`cleanup_srcu_struct()`.

Signed-off-by: Onur Özkan &lt;work@onurozkan.dev&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Boqun Feng &lt;boqun@kernel.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
</feed>
