News for hackers. Stuff that matters.
Re:The Tower of Weakenings: Memory Models for Everyone by zozbot234 on Wednesday April 06, 2022 @02:23PM (#30935676)
I think this would work well with the model as described in the article, since for every list operation you're assumed to be starting from an actual pointer to some list element, which you can use to endow the recomputed addresses with the right provenance component.
Re:The Tower of Weakenings: Memory Models for Everyone by CJefferson on Wednesday April 06, 2022 @02:34PM (#30935809)
If each element of the linked list has a different provenance, then I think you are out of luck. I could allocate the whole list in a single giant block, but that feels like it defeats the purpose -- now I'm just allocating every object in my program in one giant allocation.
Re:The Tower of Weakenings: Memory Models for Everyone by Gankra on Wednesday April 06, 2022 @02:57PM (#30936098)
Yeah "it's actually xoring array indices" is the standard solution

Or you can go Deep on memory models and try to apply Ralf's Xor Provenance Hack and claim that, well, provenance is stored in bytes, but it doesn't have to be a pointer-sized range of bytes, so let me have some horrible way to express "the high half has provenance 1, the low half has provenance 2" and handwave magic problem solved.

This is of course horrible and also not at all a portable notion to CHERI which tracks provenance at the granularity of "aligned pointer-sized region of memory". But hey, if it helps you sleep at night.

Re:The Tower of Weakenings: Memory Models for Everyone by CJefferson on Wednesday April 06, 2022 @03:14PM (#30936305)
I'm personally excited by CHERI, and feel it is part of (sorry if these words annoy some people) computing "growing up". It's interesting (to me at least) that that is the only trick I can think of (along with general pointer compression tricks, like interpreters storing 63-bit integers when a pointers last bit is set to 1), where CHERI shouldn't be (fairly) trivial to support.

I'm happy to sacrific xoring pointers, the same way I wouldn't use some "cunning trick" to build my house with half as many nails, at the risk that any minor mistake installing any of those nails would lead to my house failing over.

Re:The Tower of Weakenings: Memory Models for Everyone by markjdb on Wednesday April 06, 2022 @06:19PM (#30938182)
CHERI does permit tricks like storing flags in the low bits of a pointer, at least to some extent. Quite a lot of low level C code (including some in the CheriBSD kernel) needs that to work.