Skip to content

XDP flags reference unsoundness #2605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arctic-alpaca opened this issue Apr 11, 2025 · 1 comment
Open

XDP flags reference unsoundness #2605

arctic-alpaca opened this issue Apr 11, 2025 · 1 comment
Labels
bug Something isn't working size/small

Comments

@arctic-alpaca
Copy link

Problem:

In the s2n-quic-xdp code, the Ring::flags and Ring::flags_mut methods allow creating shared/mutable references to the flags u32. The flags u32 is shared with the kernel and written to by the kernel. This means creating a reference to the u32 violates Rust's aliasing rules.

Solution:

The flags u32 can be read using pointer std::ptr::read.

@camshaft
Copy link
Contributor

I agree this should be fixed. Thanks for highlighting the issue!

@camshaft camshaft added the bug Something isn't working label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/small
Projects
None yet
Development

No branches or pull requests

3 participants