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

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
43/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, linux
領域
backend, security

調査の方向性

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.

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

説明

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.
主要言語
Go
スター
5
フォーク
5
平均マージ
15時間 27分
マージ済み PR(30日)
41

環境構築

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

はじめの一歩

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

Azure/fiberd のほかの issue

Azure/fiberd の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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