What are the opsem effects of CHERI?

Đang mở
#625 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
760
Fork
68
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/unsafe-code-guidelines

Tất cả issue của rust-lang/unsafe-code-guidelines

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.