This repository was archived by the owner on Oct 13, 2023. It is now read-only.
[18.09 backport] Graphdriver: fix "device" mode not being detected if "character-device" bit is set#160
Merged
tiborvass merged 1 commit intodocker-archive:18.09from Feb 22, 2019
Conversation
…e" bit is set
Due to a bug in Golang (github.com/golang#27640), the "character device"
bit was omitted when checking file-modes with `os.ModeType`.
This bug was resolved in Go 1.12, but as a result, graphdrivers
would no longer recognize "device" files, causing pulling of
images that have a file with this filemode to fail;
failed to register layer:
unknown file type for /var/lib/docker/vfs/dir/.../dev/console
The current code checked for an exact match of Modes to be set. The
`os.ModeCharDevice` and `os.ModeDevice` bits will always be set in
tandem, however, because the code was only looking for an exact
match, this detection broke now that `os.ModeCharDevice` was added.
This patch changes the code to be more defensive, and instead
check if the `os.ModeDevice` bit is set (either with, or without
the `os.ModeCharDevice` bit).
In addition, some information was added to the error-message if
no type was matched, to assist debugging in case additional types
are added in future.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c7a38c2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
ping @tonistiigi @kolyshkin @andrewhsu PTAL Backporting this to prevent us running into issues if we update to a more recent version of Go at some point |
|
LGTM |
tonistiigi
approved these changes
Feb 21, 2019
tiborvass
approved these changes
Feb 22, 2019
algitbot
pushed a commit
to alpinelinux/aports
that referenced
this pull request
Mar 12, 2019
https://github.com/docker/docker-ce/releases/tag/v18.09.3 The more important fixes in this version: * When copying existing folder, ignore xattr set errors when the target filesystem doesn't support xattr. docker-archive/engine#135 * Graphdriver: fix device mode not being detected if character-device bit is set. docker-archive/engine#160 * Fix nil pointer derefence on failure to connect to containerd. docker-archive/engine#162 * Delete stale containerd object on start failure. docker-archive/engine#154
liske
pushed a commit
to liske/aports
that referenced
this pull request
Apr 7, 2019
https://github.com/docker/docker-ce/releases/tag/v18.09.3 The more important fixes in this version: * When copying existing folder, ignore xattr set errors when the target filesystem doesn't support xattr. docker-archive/engine#135 * Graphdriver: fix device mode not being detected if character-device bit is set. docker-archive/engine#160 * Fix nil pointer derefence on failure to connect to containerd. docker-archive/engine#162 * Delete stale containerd object on start failure. docker-archive/engine#154
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport of moby#38758 for 18.09. Cherry-pick was clean; no conflicts
Due to a bug in Golang (github.com/golang#27640), the "character device"
bit was omitted when checking file-modes with
os.ModeType.This bug was resolved in Go 1.12, but as a result, graphdrivers
would no longer recognize "device" files, causing pulling of
images that have a file with this filemode to fail;
The current code checked for an exact match of Modes to be set. The
os.ModeCharDeviceandos.ModeDevicebits will always be set intandem, however, because the code was only looking for an exact
match, this detection broke now that
os.ModeCharDevicewas added.This patch changes the code to be more defensive, and instead
check if the
os.ModeDevicebit is set (either with, or withoutthe
os.ModeCharDevicebit).In addition, some information was added to the error-message if
no type was matched, to assist debugging in case additional types
are added in future.
Signed-off-by: Sebastiaan van Stijn github@gone.nl
(cherry picked from commit c7a38c2)
Signed-off-by: Sebastiaan van Stijn github@gone.nl
- 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)