New() can panic on OCI specs with a missing root section
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #903 @Utkarsh-sharma47 による — マージされずにクローズ
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- go
調査の方向性
New() と Get() から開始し、その後、GetUnikernelConfig()、InitialSetup()、Exec() が spec.Root.Path にアクセスする前に使用される検証を追跡します。linux が存在し root が欠落している最小限の OCI spec に対する回帰テストのカバレッジを追加します。New() がそれを validation error で拒否し、nil-pointer panic や無効な Unikontainer を許容しない状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
New() currently validates that the parsed OCI spec contains a linux section, but does not validate that spec.Root is present.
A syntactically valid but structurally incomplete config.json, such as:
{
"linux": {}
}
can therefore reach code paths that dereference spec.Root.Path, resulting in a nil pointer panic instead of returning a validation error.
I also found that when valid unikernel annotations are present, New() can return successfully while u.Spec.Root == nil, leaving an invalid Unikontainer that may panic later.
Relevant code
New() currently checks:
if spec == nil || spec.Linux == nil {
return nil, fmt.Errorf("invalid OCI spec: linux section is required")
}
but GetUnikernelConfig() later uses:
rootFSDir := spec.Root.Path
and other paths such as InitialSetup() and Exec() also access u.Spec.Root.Path.
Minimal reproducer
Create a bundle containing:
{
"linux": {}
}
as config.json and call New() with that bundle.
Actual behavior
urunc can panic with a nil pointer dereference when the configuration fallback path accesses spec.Root.Path.
A spec containing valid unikernel annotations but no root section can also be accepted by New(), leaving Spec.Root == nil.
Expected behavior
Structurally incomplete OCI specs should be be rejected with a validation error, for example:
invalid OCI spec: root section is required
Possible direction
Validate that spec.Root is present before returning from New() / Get(), alongside the existing validation of spec.Linux.
A regression test using a minimal spec with linux present and root missing could cover this case.
- 主要言語
- Go
- スター
- 308
- フォーク
- 222
- 平均マージ
- 2日 8時間
- マージ済み PR(30日)
- 43
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
urunc-dev/urunc のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Containers handed over to runc cannot be started, killed or deleted when urunc runs without --root再び着手できるかも @Daksha1611 が 15 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
urunc-dev/urunc#1127 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
urunc-deploy cleanup never labels the node, so the cleanup DaemonSet does not run対応中かも @Sarthak-Shreshtha01 が 17 日前に担当しました。 オープンbug K8s/Tools
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
FreeBSD: docs update and rootfs detection対応中かも @yug105 が 12 日前に担当しました。 オープンdocumentation enhancement Storage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
urunc-dev/urunc#1108 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
Rumprun guests receive &, < and > as \u0026, \u003c and \u003e対応中かも @Sarthak-Shreshtha01 が 23 日前に担当しました。 オープンbug Guests
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
urunc-dev/urunc#1074 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
urunc-dev/urunc の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/arrow-swift#209 ·
メンテナーはふだん 1 日以内に返信
-
orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of once対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
influxdata/telegraf#20031 ·
メンテナーはふだん 1 日以内に返信
-
pkg/registry/file no longer builds for GOOS=windows: unguarded syscall.Stat_t in qualified_resource_migration.go対応中かも @AnshulPatil2005 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
OneBusAway/maglev#1914 ·
メンテナーはふだん 2 日以内に返信