Hacker News new | ask | show | jobs
by tveita 3303 days ago
That's a somewhat orthogonal issue. Your suggestion aims to prevent pointer access from clobbering data the pointer doesn't own. The pointer authentication protects the pointer that is being being clobbered, like a return address on a stack.

You don't need any special instruction support to do bound checked memory access. Write in Rust or Swift or whatever, and you're already making buffer overflows "impossible". The buffer overflows are already out there, in billions of lines of C and C++ code, and since we can't rewrite all the code, we should mitigate it as best we can.

1 comments

Sure, I just think my (not that well thought-out, but still) suggestion mitigates bugs in existing source code with fresh compiler support better than this thing does. A compiler/runtime using new instructions to make instruction addresses hard to clobber could instead use instructions keeping on-stack array sizes in the array pointer and maintaining it through pointer arithmetic. A compiler/runtime know when an array size is too large to fit into 23 bits, certainly on-stack arrays are never that big so your sister comment's problem about "4G" is not that big of a problem, just don't do this with large arrays.

It'd require somewhat more ISA & compiler changes but it'd solve more problems that just the one problem they solve, and I think the security of this would be easier to demonstrate, too.