Skip to content

daemon: fix panic on failed exec start#45792

Merged
corhere merged 1 commit intomoby:masterfrom
corhere:fix-45770-processevent-nil-check
Jun 22, 2023
Merged

daemon: fix panic on failed exec start#45792
corhere merged 1 commit intomoby:masterfrom
corhere:fix-45770-processevent-nil-check

Conversation

@corhere
Copy link
Contributor

@corhere corhere commented Jun 22, 2023

If an exec fails to start in such a way that containerd publishes an exit event for it, daemon.ProcessEvent will race daemon.ContainerExecStart in handling the failure. This race has been a long-standing bug, which was mostly harmless until 4bafaa0. After that change, the daemon would dereference a nil pointer and crash if ProcessEvent won the race. Restore the status quo buggy behaviour by adding a check to skip the dereference if execConfig.Process is nil.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

If an exec fails to start in such a way that containerd publishes an
exit event for it, daemon.ProcessEvent will race
daemon.ContainerExecStart in handling the failure. This race has been a
long-standing bug, which was mostly harmless until
4bafaa0. After that change, the daemon
would dereference a nil pointer and crash if ProcessEvent won the race.
Restore the status quo buggy behaviour by adding a check to skip the
dereference if execConfig.Process is nil.

Signed-off-by: Cory Snider <csnider@mirantis.com>
@corhere corhere added this to the 25.0.0 milestone Jun 22, 2023
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dockerd panic: runtime error at monitor.go:189

3 participants