Skip to content
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

Unsoundness in OwnedDescriptor::atomic #1643

Open
lwz23 opened this issue Dec 9, 2024 · 0 comments
Open

Unsoundness in OwnedDescriptor::atomic #1643

lwz23 opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lwz23
Copy link

lwz23 commented Dec 9, 2024

Describe the bug

Considering that watchdog is a pub mod, OwnedDescriptor is a pub struct and atomic is a pub field, I assume that users can directly manipulate this field. This potential situation could result in self.instruction_pointer being a null pointer, and directly dereferencing it might trigger undefined behavior (UB).

To reproduce

  1. crate a OwnedDescriptor struct.
  2. set OwnedDescriptor::atomic to a null pointer.
  3. call confirm method.

System info

I think any platform can reproduce this bug.

@lwz23 lwz23 added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants