What are the opsem effects of CHERI?

オープン
#625 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
compilers

調査の方向性

The issue asks for a concise summary of CHERI's operational semantics effects on Rust. Start by reading the linked Zulip/IRLO discussions and the CHERIoT limitations comment. Understand how usize being 64-bit changes pointer operations like with_exposed_provenance, int as ptr, and wrapping_offset. The goal is to document when programs might safely abort and the implications for unsafe code guidelines.

索引モデルが issue の本文から書いたものです。

説明

We discussed this on Zulip multiple times and maybe even on IRLO but I could not find a concise summary. This assume that on CHERI, usize is 64bit -- discussion of other ways choices should be delegated to other threads.

So what operations work different on CHERI than they would on all other Rust targets?

  • with_exposed_provenance/int as ptr simply does not work. We should probably reject it at compile time; if we don't then the operation will create a no-capability pointer and the program will (safely) abort at runtime when that pointer is used to access memory.
  • wrapping_offset may sometimes "lose" the capability. Due to CHERI compressing capabilities into 64bit, they cannot precisely represent capabilities that are too far away from the address the pointer is pointing to, so something like ptr.wrapping_add(BIG).wrapping_sub(BIG) might break the pointer. The program will safely abort at runtime when such a pointer is used to access memory. This can also affect operations based on wrapping_offset, such as with_addr.
  • Copying a pointer byte-for-byte with MaybeUninit<u8> (or similar) no longer works: the copy may lose its permissions, using it to access memory will (safely) abort the process.
  • CHERIoT has some more concerning limitations: pointers to stack variables cannot be stored in global variables or the heap.

I think that's it? Basically we get some safe aborts in cases where the program should not abort, but that should hopefully be rare and if it happens, it shouldn't be too hard to debug.

主要言語
言語のデータがありません
スター
760
フォーク
68
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/unsafe-code-guidelines のほかの issue

rust-lang/unsafe-code-guidelines の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。