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

RUSTSEC-2024-0408: Unsound usages of std::slice::from_raw_parts #46

Open
github-actions bot opened this issue Dec 5, 2024 · 0 comments · Fixed by tikv/tikv#17942
Open

RUSTSEC-2024-0408: Unsound usages of std::slice::from_raw_parts #46

github-actions bot opened this issue Dec 5, 2024 · 0 comments · Fixed by tikv/tikv#17942

Comments

@github-actions
Copy link

github-actions bot commented Dec 5, 2024

Unsound usages of std::slice::from_raw_parts

Details
Status unsound
Package pprof
Version 0.13.0
URL tikv/pprof-rs#232
Date 2024-12-04

The library breaks the safety assumptions when using unsafe API std::slice::from_raw_parts. First, when using the API in iterator implementation (TempFdArrayIterator.next), generic type could be any type, which would create and pass a misaligned pointer to the unsafe API. Second, when validating the address, the code passed the type c_void, which could also be any type, leading to potential uninitialized memory exposure.

Two unsound usages here highlight the necessity for developers to perform type checks before doing type conversion with unsafe API.

The panic caused by the misalignment causes several downstream applications (e.g., greptimedb) to crash when using pprof::report::ReportBuilder::build.

This was patched in 0.14.0.

The developer also suggested moving to pprof2.

See advisory page for additional details.

LykxSassinator added a commit to LykxSassinator/tikv that referenced this issue Dec 5, 2024
ti-chi-bot bot pushed a commit to tikv/tikv that referenced this issue Dec 5, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this issue Dec 9, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this issue Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
0 participants