Is there any reason for the void cast here? Theres no return value in use. (void)strlcpy(des_pass, pass,sizeof(des_pass));
strlcpy returns a size_t, so just to silence the discarded return value warning https://linux.die.net/man/3/strlcpy
Try to make sudo less vulnerable to Rowhammer attacks
41–50 of 147 posts
Re: Try to make sudo less vulnerable to Rowhammer attacks
#42i enjoyed this part: #define AUTH_SUCCESS 0x52a2925 /\* 0101001010100010100100100101 */ #define AUTH_FAILURE 0xad5d6da /* 1010110101011101011011011010 */ #define AUTH_INTR 0x69d61fc8 /* 1101001110101100001111111001000 */ #define AUTH_ERROR 0x1629e037 /* 0010110001010011110000000110111 */ #define AUTH_NONINTERACTIVE 0x1fc8d3ac /* 11111110010001101001110101100 \*/ going to see how i can work this into a project :)
I don't get it, what's special about these numbers?
Re: Try to make sudo less vulnerable to Rowhammer attacks
#43i enjoyed this part: #define AUTH_SUCCESS 0x52a2925 /\* 0101001010100010100100100101 */ #define AUTH_FAILURE 0xad5d6da /* 1010110101011101011011011010 */ #define AUTH_INTR 0x69d61fc8 /* 1101001110101100001111111001000 */ #define AUTH_ERROR 0x1629e037 /* 0010110001010011110000000110111 */ #define AUTH_NONINTERACTIVE 0x1fc8d3ac /* 11111110010001101001110101100 \*/ going to see how i can work this into a project :)
Very nice indeed. Such a simple mitigation and it makes evil people sad, which makes me happy.
Re: Try to make sudo less vulnerable to Rowhammer attacks
#44Earlier quoted context omitted.
I don't get it, what's special about these numbers?
Takes many bit flips to go from one pattern to another.
the distance between success and failure is 28
Re: Try to make sudo less vulnerable to Rowhammer attacks
#45I thought that Rowhammer was a thing of the past. Out of curiosity I found code to test for this and ran it on some of my hosts. My old desktop - I7-4770K/DDR3 - was susceptible. My old server - Xeon X3460/DDR3+ECC - was not. I upgraded the desktop with components based on a Ryzen 7 7700X/DDR5. It tested not susceptible. I'm not sure if that's a result of RAM designed not to be susceptible or that (I think) DDR5 RAM…
Re: Try to make sudo less vulnerable to Rowhammer attacks
#46Re: Try to make sudo less vulnerable to Rowhammer attacks
#47Earlier quoted context omitted.
From the commit: “The values used were chosen such that it takes a large number of bit flips to change from allowed to denied. Using random values doesn't really protect against this attack.” It would be neat to see an algorithm that generates suitable values.
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…
And indeed, the two values ate bitwise complements.
Re: Try to make sudo less vulnerable to Rowhammer attacks
#48Re: Try to make sudo less vulnerable to Rowhammer attacks
#49i enjoyed this part: #define AUTH_SUCCESS 0x52a2925 /\* 0101001010100010100100100101 */ #define AUTH_FAILURE 0xad5d6da /* 1010110101011101011011011010 */ #define AUTH_INTR 0x69d61fc8 /* 1101001110101100001111111001000 */ #define AUTH_ERROR 0x1629e037 /* 0010110001010011110000000110111 */ #define AUTH_NONINTERACTIVE 0x1fc8d3ac /* 11111110010001101001110101100 \*/ going to see how i can work this into a project :)
> I enjoyed this part Very nice indeed. Such a simple mitigation and it makes evil people sad, which makes me happy.
If the attacker is already running code on your system, you kind of lost anyway.
Re: Try to make sudo less vulnerable to Rowhammer attacks
#50I thought that Rowhammer was a thing of the past. Out of curiosity I found code to test for this and ran it on some of my hosts. My old desktop - I7-4770K/DDR3 - was susceptible. My old server - Xeon X3460/DDR3+ECC - was not. I upgraded the desktop with components based on a Ryzen 7 7700X/DDR5. It tested not susceptible. I'm not sure if that's a result of RAM designed not to be susceptible or that (I think) DDR5 RAM…