News for hackers. Stuff that matters.
Re:Towards Linux Kernel Memory Safety by anameaname on Wednesday November 15, 2017 @11:56PM (#15710348)
Source for those interested: https://github.com/torvalds/linux/blob/master/lib/refcount.c

I'm kind of surprised that the authors went with compare-and-exchange for their ref count, rather than get-and-increment. Even if the counter does overflow, it's usually detectable, and reversible. This is true even in the face of concurrent updates. The benefit is that there is only one atomic operation in the fast path.

Re:Towards Linux Kernel Memory Safety by Someone on Thursday November 16, 2017 @04:16AM (#15711268)
”usually detectable” isn’t good enough. You must assume attackers will try to hit your code zillions of times until they hit the ‘unusual’ case.