-
Notifications
You must be signed in to change notification settings - Fork 85
RAM initialization code violates pointer provenance #300
Comments
Linking relevant issues so others can follow breadcrumbs:
Edit: Added tock-os issue |
Copying @RalfJung's comment from that Zulip thread:
I'd say the most practical way to continue is thus:
|
25: Insert a `compiler_fence` after initialization r=therealprof a=jonas-schievink cc rust-embedded/cortex-m-rt#300 Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Note that I was talking about the "writing to statics without actually going through the The issue about out-of-bounds accesses is a separate one, for which I created a new UCG issue as this has come up before: rust-lang/unsafe-code-guidelines#259. |
cortex-m-rt/src/lib.rs
Lines 939 to 959 in 96525a6
This code uses a pointer to a single
u32
, but writes an arbitrary amount of data beyond theu32
. This is UB, as it violates the contract ofptr::offset
, which is called by r0. Namely:The text was updated successfully, but these errors were encountered: