News for hackers. Stuff that matters.
Re:Imposing memory security in C [video] by Dylan16807 on Friday February 28, 2025 @12:59PM (#43208488)
Yes but how do you accomplish that? If you do nothing at all, pointers can tear. And allocation sizes too if they're stored inline.
Re:Imposing memory security in C [video] by pizlonator on Friday February 28, 2025 @02:44PM (#43209500)
The capability is internally a pointer to a monotonic GC-allocated object.

That capability pointer is always stored and loaded using monotonic 64-bit accesses.

Therefore, in the worst case you'll get a pointer that is torn from its capability, and then you'll trap accessing that pointer. But you'll never get a corrupt capability.

If you don't want the pointer to tear from its capability, just use `_Atomic`, `volatile`, or `std::atomic`. Then Fil-C uses lock-free shenanigans to make sure that the capability and pointer travel together and don't tear from one another.

Re:Imposing memory security in C [video] by Dylan16807 on Friday February 28, 2025 @03:34PM (#43210192)
Okay, in that case I do think one of the data-holding types in rust is a fair comparison, adding some runtime checks to let you be looser about ownership. Then you can write a function to split/share an array without a single bit of unsafe code.