0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linuxのメモリ保護に関するあるハードウェア支援の対応について思ったこと

Posted at

先週LWNにメモリ保護に関するハードウェア支援の対応に関する記事があった。OSのSupervisor権限とは何なのか。解消されない疑問を持ったまま週末が終わろうとしているので、Qiitaに記憶しようと思う。

X86にはユーザスペースの使用しているページにアクセス制限を付与するハードウェア支援が存在する。この機能を使用したユーザスペースのプロセスに対して、カーネルはWriteまたはRead+Writeアクセスが許可されない。

一つは、MPK (Memory Protection Key)。
1つのプロセスが16個のページ領域をアクセス制限ができる機能(16という数値が何から来ているのかは不明)。
“Write disable”または“Access disable (= Write disable + Read disable)”の制限ができる。
アクセス変更のオーバヘッドが大きいらしく、プロセスのパフォーマンスが悪くなる。
2016年にLinux4.6でサポートされている。

もう一つはPKS (Protection Key Supervision)。
MPKと同様の機能を持つ。パフォーマンス問題を軽減したハードウェア支援らしい。
2020年7月14日にパッチが公開されている。

カーネルの致命的なバグによってユーザスペースプロセスが動かなくなったり、セキュリティホールを回避できないということはある。だから、この機能は必要なのかもしれない。
でも、この機能を使うことはOSの根本設計から外れているようにも思える。

私は保守的なのだろう。私の世界が狭いのだろう。

参考資料
https://lwn.net/Articles/643797/
https://lwn.net/Articles/826091/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?