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

report unsound issue in bcc #2042

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions crates/bcc/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "bcc"
date = "2024-08-21"
url = "https://github.com/rust-bpf/rust-bcc/issues/200"
#informational = "unmaintained"
categories = ["memory-corruption"]
keywords = ["misalignment"]

[versions]
patched = []
```

# Unsound usage of unsafe implementation from `Vec<u8>` to `T`

Unsafe misaligned conversion found at function `null_or_mut_ptr`. The pointer to 'Vec<u8>' is converted to a struct `T`. This unsound implementation would create a misalignment issues if the type size of `Vec<u8>` is smaller than the type size of struct `T`.
If we further manipulate the problematic converted types, it would potentially lead to different undefined behavior such as access out-of-bound.

In the meantime, bcc will no longer be maintained. Users are encouraged to migrate to libbpf-rs.