Skip to content

Fix: Ensure memory-layout safety in Linux clock interception - #8

Open
mertcano wants to merge 1 commit into
SubzeroLabs:mainfrom
mertcano:mertcano-patch-2
Open

Fix: Ensure memory-layout safety in Linux clock interception#8
mertcano wants to merge 1 commit into
SubzeroLabs:mainfrom
mertcano:mertcano-patch-2

Conversation

@mertcano

Copy link
Copy Markdown

Description

This PR addresses High-severity memory layout issues in the deterministic-simulator repository, as identified in the workspace-wide security audit.

Vulnerabilities & Security Defects Remediated:

  • Clock Interceptor Memory Safety (msim/src/sim/time/mod.rs): The Linux monotonic-clock path previously transmuted the opaque std::time::Instant representation directly into libc::timespec. This is not a stable ABI contract and failed with invalid timestamps under current Rust toolchains. The interceptor now safely and explicitly serializes the simulated duration directly into the tv_sec and tv_nsec fields.

### Description
This PR addresses High-severity memory layout issues in the `deterministic-simulator` repository, as identified in the workspace-wide security audit.

**Vulnerabilities & Security Defects Remediated:**
* **Clock Interceptor Memory Safety (`msim/src/sim/time/mod.rs`):** The Linux monotonic-clock path previously transmuted the opaque `std::time::Instant` representation directly into `libc::timespec`. This is not a stable ABI contract and failed with invalid timestamps under current Rust toolchains. The interceptor now safely and explicitly serializes the simulated duration directly into the `tv_sec` and `tv_nsec` fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant