Repository navigation
runsc/boot: validate version before loading async pages during restore - #14279
DARSHANR007 wants to merge 1 commit into
Conversation
1968604 to
5f24412
Compare
|
is the PR still alive? |
5f24412 to
ddf6027
Compare
Yes , the PR is active. I have rebased onto the latest master to resolve merge conflicts. The requested nil check on restoreDone was addressed in onRestoreFailed. @nybidari @milantracy could you please take another look and approve CI? |
### Problem In `runsc/boot/controller.go`, `Restore()` spawned `kernel.NewAsyncMFLoader` before checking the checkpoint version. When restoring a checkpoint from a different `runsc` build, the background loader started parsing incompatible page headers immediately, causing a panic (`makeslice: len out of range`) instead of returning a clean error. ### My fix Move statefile reading and the version check before creating `mainMF` and starting `NewAsyncMFLoader`. Incompatible checkpoints now fail fast with a clear version error. Fixes #14278 FUTURE_COPYBARA_INTEGRATE_REVIEW=#14279 from DARSHANR007:fix-restore-version-check ddf6027 PiperOrigin-RevId: 1005912581
### Problem In `runsc/boot/controller.go`, `Restore()` spawned `kernel.NewAsyncMFLoader` before checking the checkpoint version. When restoring a checkpoint from a different `runsc` build, the background loader started parsing incompatible page headers immediately, causing a panic (`makeslice: len out of range`) instead of returning a clean error. ### My fix Move statefile reading and the version check before creating `mainMF` and starting `NewAsyncMFLoader`. Incompatible checkpoints now fail fast with a clear version error. Fixes #14278 FUTURE_COPYBARA_INTEGRATE_REVIEW=#14279 from DARSHANR007:fix-restore-version-check ddf6027 PiperOrigin-RevId: 1005912581
### Problem In `runsc/boot/controller.go`, `Restore()` spawned `kernel.NewAsyncMFLoader` before checking the checkpoint version. When restoring a checkpoint from a different `runsc` build, the background loader started parsing incompatible page headers immediately, causing a panic (`makeslice: len out of range`) instead of returning a clean error. ### My fix Move statefile reading and the version check before creating `mainMF` and starting `NewAsyncMFLoader`. Incompatible checkpoints now fail fast with a clear version error. Fixes #14278 FUTURE_COPYBARA_INTEGRATE_REVIEW=#14279 from DARSHANR007:fix-restore-version-check ddf6027 PiperOrigin-RevId: 1005912581
|
[🤖] Needs rebase. |
|
@milantracy Please can you review the PR here. Thanks |
|
there are some failures at https://buildkite.com/gvisor/pipeline/builds/52153 for the PR. |
Move statefile reading and version check before spawning AsyncMFLoader so incompatible checkpoints fail fast with a version error instead of panicking. Fixes gvisor#14278
7d41129 to
e42a6d2
Compare
@milantracy I accidently created a merge commit while syncing with upstream , which caused the buildkite failures . Ive rebased it . Please have a look |
| if cm.l.restoreDone != nil { | ||
| cm.l.restoreDone.Broadcast() | ||
| } |
|
|
||
| checkpointVersion := cm.restorer.metadata[VersionKey] | ||
| currentVersion := version.Version() | ||
| if checkpointVersion != currentVersion { |
There was a problem hiding this comment.
This covers the version-mismatch case. A checkpoint with a matching version but a corrupt pages_meta.img still panics the sentry.
Problem
In
runsc/boot/controller.go,Restore()spawnedkernel.NewAsyncMFLoaderbefore checking the checkpoint version. When restoring a checkpoint from a differentrunscbuild, the background loader started parsing incompatible page headers immediately, causing a panic (makeslice: len out of range) instead of returning a clean error.My fix
Move statefile reading and the version check before creating
mainMFand startingNewAsyncMFLoader. Incompatible checkpoints now fail fast with a clear version error.Fixes #14278