Skip to content

docker: fix nil pointer dereference when GraphDriver is nil#3816

Merged
dims merged 1 commit intogoogle:masterfrom
dims:fix-graphdriver-nil-pointer
Jan 16, 2026
Merged

docker: fix nil pointer dereference when GraphDriver is nil#3816
dims merged 1 commit intogoogle:masterfrom
dims:fix-graphdriver-nil-pointer

Conversation

@dims
Copy link
Collaborator

@dims dims commented Jan 16, 2026

The migration to github.com/moby/moby modules in b20bcf1 changed GraphDriver from a value type to a pointer type. This causes a nil pointer dereference when Docker doesn't include GraphDriver in the container inspect response (which can happen with certain storage drivers or container configurations).

Add a nil check before accessing GraphDriver.Data and log a warning at V(4) verbosity level when GraphDriver is not found.

Fixes #3815

@dims dims force-pushed the fix-graphdriver-nil-pointer branch from 690c0d2 to f80a8be Compare January 16, 2026 14:34
The migration to github.com/moby/moby modules in b20bcf1 changed
GraphDriver from a value type to a pointer type. This causes a nil
pointer dereference when Docker doesn't include GraphDriver in the
container inspect response (which can happen with certain storage
drivers or container configurations).

Add a nil check before accessing GraphDriver.Data and log a warning
at V(4) verbosity level when GraphDriver is not found.

Fixes google#3815

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
@dims dims force-pushed the fix-graphdriver-nil-pointer branch from f80a8be to d238044 Compare January 16, 2026 14:36
@dims dims merged commit 7cbdee9 into google:master Jan 16, 2026
10 checks passed
@dims
Copy link
Collaborator Author

dims commented Jan 16, 2026

@thaJeztah FYI please see the change i made here, others may run into it in other projects.

@thaJeztah
Copy link
Contributor

Ah, thanks!

We should probably look if we can remove all the devicemapper bits; at least, I think this is only used when using the devicemapper storage driver, which has been removed from docker for some time now.

humblec added a commit to humblec/kubernetes that referenced this pull request Feb 27, 2026
Update github.com/google/cadvisor from v0.56.0 to v0.56.2.

v0.56.2 fixes a nil pointer dereference when Docker GraphDriver is nil
(google/cadvisor#3816).

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV on startup

2 participants