4

sudo 對 ROWHAMMER 攻擊的 mitigation

 7 months ago
source link: https://blog.gslin.org/archives/2024/01/29/11626/sudo-%e5%b0%8d-rowhammer-%e6%94%bb%e6%93%8a%e7%9a%84-mitigation/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

sudo 對 ROWHAMMER 攻擊的 mitigation

看到「Rowhammer Resistant Coding in Sudo (github.com/sudo-project)」這邊的討論,提到了 sudo 專案 (變成 root 那個 sudo 軟體) 怎麼緩解 ROWHAMMER 攻擊的實作,原連結是去年九月時 GitHub 上的 commit:「Try to make sudo less vulnerable to ROWHAMMER attacks.」。

從 commit 裡面可以看到這個:

- #define AUTH_SUCCESS		0
- #define AUTH_FAILURE		1
- #define AUTH_INTR		2
- #define AUTH_ERROR		3
- #define AUTH_NONINTERACTIVE	4
+ #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 */

可以看到想法上是讓要攻擊時需要改變的 bit 數量大幅增加?尤其是對 AUTH_SUCCESShamming distance

另外這段也是類似的設計:

+ /* Allowed by policy (rowhammer resistent). */
+ #undef ALLOW
+ #define ALLOW	 0x52a2925	/* 0101001010100010100100100101 */
+ 
+ /* Denied by policy (rowhammer resistent). */
+ #undef DENY
+ #define DENY	 0xad5d6da	/* 1010110101011101011011011010 */

這邊 ALLOWDENY 這邊也是把 hamming distance 設計到最大,兩個 XOR 後剛好是 0xffffffff

會不會變成安全相關軟體實作上的 practice?

Related

玩了一下 OpenSnitch,Linux 下的 Application Firewall

這是在 Hacker News 上的討論「Brute-forcing a macOS user’s real name from a browser using mDNS (fingerprint.com)」這篇看到的,裡面一開始是提到 Mac 上面的 Little Snitch,可以針對特定應用程式設定防火牆規則,而在 Linux 上對應的解決方案則是 OpenSnitch,但一直沒有嘗試,所以就試著用看看... 套件分成兩個部分,一個是 OpenSnitch 的主程式,另外一個是 GUI 的部分。 而在 Ubuntu 22.04 上裝有點麻煩,因為 Ubuntu 22.04 上預設的 grpc package 似乎是有 bug,需要裝新版解決。 不過我在找 PPA 的時候發現有人包了輔助套件:「OpenSnitch - application firewall (Xenial & newer)」。 這個套件本身是沒有包 OpenSnitch 主程式與…

July 16, 2023

In "Computer"

解 ocserv 因為沒有使用 DTLS 而導致速度很慢的問題...

最近偏好用 ocserv 來跑 VPN。在連上 full-route VPN 後測試發現速度偏慢,發現是沒有走 UDP 的 DTLS,只有 TCP 的 TLS 流量... 找了一下發現用有人遇過了,可以用 workaround 解:「OpenConnect not working with DTLS」。 作者發現是 ocserv.socket 有問題,打算整個抽開。方法是註解掉 /lib/systemd/system/ocserv.service 裡的 Requires=ocserv.socket 與 Also=ocserv.socket,然後在 systemd 裡一起處理: sudo systemctl stop ocserv sudo systemctl disable ocserv.service sudo systemctl disable ocserv.socket sudo systemctl daemon-reload sudo systemctl start ocserv…

October 30, 2018

In "Computer"

在 FreeBSD 上安裝 Merb 1.0

在上一篇提到 FreeBSD 上暫時因為 RubyGems 版本問題,沒辦法裝 Merb 1.0,我決定自己來惡搞... 一開始是想裝 Ruby 1.9,據說內建 RubyGems,但裝上去後發現內建的版本是 RubyGems 1.0.1,比 FreeBSD Ports 的還舊,還是自己動手把 Ports 裡的 RubyGems 升級好了... 要將 FreeBSD Ports 裡的 RubyGems 更新到 1.3.1,最麻煩的是要生出 pkg-plist,這點由 ports maintainer jw at innerewut.de 做的差不多了,他寫了 x-generate-plist 會幫你產生 pkg-plist,所以很容易就把 pkg-plist 做完然後 send-pr。(參考 ports/128731: [PATCH] devel/ruby-gems: update to 1.3.1,裡面有 patch file) 升級完成後就是要裝 Merb…

November 10, 2008

In "Computer"

a611ee8db44c8d03a20edf0bf5a71d80?s=49&d=identicon&r=gAuthor Gea-Suan LinPosted on January 29, 2024January 29, 2024Categories Computer, Hardware, Murmuring, Programming, Security, SoftwareTags attack, distance, hamming, memory, rowhammer, security, sudo

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK