Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I still don't understand why CPUs don't provide support for 'fat pointers'. ARM has 'load pair' to update two registers in one go, it would just need a 'load/store from array' instruction to check that a pointer is inside the pair address to have a very efficient mechanism (efficient from an instruction count point of view at least, of course the data bandwith and cache impact are still here).


"Fatter than normal" pointers have a lot of disadvantages (it's been explored extensively as part of CHERI, etc) for the upsides they give you. For the purpose of use after free/buffer overflow finding, it's IMHO, not a great fit (there are other uses, of course).

"Tagging within existing sized pointers", ARM does have some hardware support for (see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc....)

It won't verify tags, but it has explicit support for ignoring bits, which is very helpful.


Gwydion Dylan used a two-word representation for values - a full word as a type tag, and then a word for the value itself (whether pointer or int). It was an interesting experiment, but multicore basically killed it. Once your basic value representation is more than a word, then every load/store/manipulation of a value requires a lock around it, to prevent corruption if the thread is preempted when the type has been written but the value has not. The locking overhead kills performance.

Or you can go with a GIL (but for compiled code) the way Python and early Ruby/JS implementations did, but that hasn't worked out terribly well for them either.


If by "fatter than normal" you mean using bits of the memory address to do interesting things, SPARC does so with ADI in hardware:

https://lazytyped.blogspot.it/2018/02/libcmalloc-meets-adihe...


No, by fatter than normal I mean, say, 96 or 128 bit pointers.

I'm aware of SPARC ADI :) It does not have fatter-than-normal pointers, it uses 4 bit tagging of the memory address by reusing bits 63-60 of the pointer.

That is "tagging within existing pointers"


As I said it depends on what you mean by “fatter than normal”.


Many do, all the way back to 1961.

https://en.wikipedia.org/wiki/Burroughs_large_systems

passing by the Xerox PARC machines, Lisp Machines and many others, including the ill fated iAPX 432.

https://en.wikipedia.org/wiki/Intel_iAPX_432

If you could afford a Sparc M7, C on Solaris has been more type safe since version 11

https://www.youtube.com/watch?v=krOhcjF5Fsw

http://www.oracle.com/technetwork/server-storage/softwareins...

https://docs.oracle.com/cd/E53394_01/html/E54815/gqajs.html

The main issue is not if the CPU provide support, rather forcing the devs to actually bother to use them.

But since many want speed at any cost, it will only get there with a new generation, more open to trade performance for actually secure code.


The IBM iSeries, or whatever its latest names is, has 128bit software pointers, with 65bit HW pointers, where the extra bit indicates whether the value has been tampered with in userland. AFAIR, checks are still all implemented in software, by relying on a runtime trusted code generator.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: