News for hackers. Stuff that matters.
Re:Rowhammer Resistant Coding in Sudo by f_devd on Sunday January 28, 2024 @11:22AM (#39167116)
The basic algorithm for the 2-enum case from the commit seems to just be `enum { A = rand(), B = ~A}`.

Although I'm not sure if it's optimal, the many case seems to be the same as the 2-case but repeated for every 2 items. I expect they double checked that the amount of bitflips is still pretty high.

Maybe a better algorithm for the many case would be something like the popcnt parallel patterns:

* 0b0101010101010101

* 0b0011001100110011

* 0b0000111100001111

* 0b0000000011111111

Since they would all have equal hamming distance between each of the entries.

Re:Rowhammer Resistant Coding in Sudo by tomsmeding on Sunday January 28, 2024 @12:19PM (#39167746)
The n=2 case also occurs in the commit: https://github.com/sudo-project/sudo/commit/7873f8334c8d3103...

And indeed, the two values ate bitwise complements.

Re:Rowhammer Resistant Coding in Sudo by mcculley on Sunday January 28, 2024 @11:24AM (#39167136)
Yeah, I was specifically wondering about n>2. Your approach seems reasonable.