Stop one grant's engine from replacing another grant's engine socket

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

Maintainer thường phản hồi trong vòng 1 ngày

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
43/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, linux
Lĩnh vực
backend, security

Hướng nghiên cứu

Start with pkg/runtime/host/engine_linux.go and trace engineUID and makeEngineDir to see how grant engine directories and sockets are set up. Compare the two proposed options and check how fiberd passes its API socket descriptor. Done means one grant's engine cannot replace another grant's engine.sock across backends; the issue does not specify which option to implement.

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

Mô tả

bug

Every grant's device engine runs as one uid, -engine-uid (engineUID in pkg/runtime/host/engine_linux.go), and fiberd hands each grant's engine directory <RunDir>/<grant>/engine/ to that uid (makeEngineDir). The engine binds engine.sock there itself.

So one grant's engine can reach every other grant's engine directory, since <RunDir>/<grant> is root's 0755 and the directories all belong to the same uid. An engine that a hostile fiber manages to compromise through its request lines could unlink another grant's engine.sock and bind its own in its place. That grant's fibers would then talk to the wrong engine, which can read and answer for their slices. The peer check does not help, because it runs inside the engine being impersonated.

This came up in the GPU PoC's (#4) review of the Cloud Hypervisor vsock link. It holds on every backend.

Options.

  • fiberd binds engine.sock as root and passes the listening descriptor to the engine, as it does for its own API socket, so the engine needs no write access to its directory.
  • Give each grant's engine its own uid, picked from a pool the way runc grants get user namespace slots.
Ngôn ngữ chính
Go
Star
5
Fork
5
Merge trung bình
15 giờ 27 phút
Pull request đã merge (30 ngày)
41

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 Azure/fiberd

Tất cả issue của Azure/fiberd

Issue tương tự

Thêm issue về Go

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.