3 ms·
> I can assure you that you cannot access undefined memory regions by doing this in Go. Current implementation of slices and interfaces in Go is not memory saf
by ngrilly 4y ago
> I can assure you that you cannot access undefined memory regions by doing this in Go.
Current implementation of slices and interfaces in Go is not memory safe in presence of data races:
https://blog.stalkr.net/2022/01/universal-go-exploit-using-data-races.html https://blog.stalkr.net/2022/01/universal-go-exploit-using-d...
- foldr 4y agoThis is the kind of edge case you can find in lots of languages, including Rust (which has plenty of past and present soundness bugs).
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- preseinger 4y agoData races are violations of the memory model; of course any code which produces data races cannot be understood as memory safe?
- int_19h 4y agoThat's part of what the Rust borrow checker does for you: tracking who owns what and enforcing single ownership makes data races that much harder to cause.
- ngrilly 4y agoAs far as I remember, some languages like Java are memory safe even if the code produces data races. That means you can't have a reference to a value supposed to be of type A being actually of type B.