You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docker commands cp, save and export allow replacing irregular files - e.g. devices under /dev. Please see the following screenshot to demonstrate this misbehaviour:
As you can see, the device /dev/random was replaced with a file containing the saved docker image. This was originally discovered when executing docker save <image> -o /dev/null when performing tests, only to find out that applications relying on the /dev/null device are misbehaving.
While I think there's no valid use-case for this behaviour the best solution would be to disallow irregular files for the commands mentioned above. This prevents people from accidentally damaging parts of their system.
A PR regarding this is on its way.
Steps to reproduce the issue:
Pull an arbitrary docker image: docker pull ubuntu:latest
Save the pulled image to a file using the -o option: docker save ubuntu:latest -o /dev/random
Confirm that the device itself has been replaced with a regular file: stat /dev/random shows regular file instead of character special file.
Describe the results you received:
The device/irregular file has been replaced with the output of cp/export/save
Describe the results you expected:
Replacing devices/irregular files should be prevented by the CLI to prevent system damage.
Description
The docker commands
cp
,save
andexport
allow replacing irregular files - e.g. devices under/dev
. Please see the following screenshot to demonstrate this misbehaviour:As you can see, the device
/dev/random
was replaced with a file containing the saved docker image. This was originally discovered when executingdocker save <image> -o /dev/null
when performing tests, only to find out that applications relying on the/dev/null
device are misbehaving.While I think there's no valid use-case for this behaviour the best solution would be to disallow irregular files for the commands mentioned above. This prevents people from accidentally damaging parts of their system.
A PR regarding this is on its way.
Steps to reproduce the issue:
docker pull ubuntu:latest
-o
option:docker save ubuntu:latest -o /dev/random
stat /dev/random
showsregular file
instead ofcharacter special file
.Describe the results you received:
The device/irregular file has been replaced with the output of
cp
/export
/save
Describe the results you expected:
Replacing devices/irregular files should be prevented by the CLI to prevent system damage.
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: