moby/daemon
Sebastiaan van Stijn 44152f6fb6 daemon: daemon.prepareMountPoints(): fix panic if mount is not a volume
The daemon.lazyInitializeVolume() function only handles restoring Volumes
if a Driver is specified. The Container's MountPoints field may also
contain other kind of mounts (e.g., bind-mounts). Those were ignored, and
don't return an error; 1d9c8619cd/daemon/volumes.go (L243-L252C2)

However, the prepareMountPoints() assumed each MountPoint was a volume,
and logged an informational message about the volume being restored;
1d9c8619cd/daemon/mounts.go (L18-L25)

This would panic if the MountPoint was not a volume;

    github.com/docker/docker/daemon.(*Daemon).prepareMountPoints(0xc00054b7b8?, 0xc0007c2500)
            /root/rpmbuild/BUILD/src/engine/.gopath/src/github.com/docker/docker/daemon/mounts.go:24 +0x1c0
    github.com/docker/docker/daemon.(*Daemon).restore.func5(0xc0007c2500, 0x0?)
            /root/rpmbuild/BUILD/src/engine/.gopath/src/github.com/docker/docker/daemon/daemon.go:552 +0x271
    created by github.com/docker/docker/daemon.(*Daemon).restore
            /root/rpmbuild/BUILD/src/engine/.gopath/src/github.com/docker/docker/daemon/daemon.go:530 +0x8d8
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x564e9be4c7c0]

This issue was introduced in 647c2a6cdd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a490248f4d)
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-07-07 16:02:17 -04:00
..
cluster gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
config refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
discovery bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
events daemon: normalize comment formatting 2019-11-27 15:43:53 +01:00
exec Handle blocked I/O of exec'd processes 2019-06-21 12:02:15 -04:00
graphdriver d/graphdriver/copy: support src fs w/o xattr support 2023-05-04 15:28:49 -04:00
images gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
initlayer Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
links daemon: normalize comment formatting 2019-11-27 15:43:53 +01:00
listeners Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
logger awslogs: fix non-blocking log drop bug 2023-04-17 13:32:48 -07:00
names Add canonical import comment 2018-02-05 16:51:57 -05:00
network Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
stats daemon/stats: fix notRunningErr / notFoundErr detected as unused (false positive) 2022-08-17 18:11:31 +02:00
testdata Remove libtrust dep from api 2017-09-06 12:05:19 -04:00
apparmor_default.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
apparmor_default_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
archive.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
archive_tarcopyoptions.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
archive_tarcopyoptions_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
archive_tarcopyoptions_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
archive_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
archive_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
attach.go Replace errors.Cause() with errors.Is() / errors.As() 2020-04-29 00:28:41 +02:00
auth.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
changes.go daemon: add "isWindows" const 2019-10-17 23:49:43 +02:00
checkpoint.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
cluster.go Move network conversions out of API router 2018-06-27 17:11:29 -07:00
commit.go daemon: add "isWindows" const 2019-10-17 23:49:43 +02:00
configs.go Merge configs/secrets in unix implementation 2018-02-16 11:25:14 -05:00
configs_linux.go Add canonical import comment 2018-02-05 16:51:57 -05:00
configs_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
configs_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
container.go gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
container_linux.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
container_operations.go Move HostGatewayName const to opts, and change vars to consts 2020-10-30 21:17:34 +01:00
container_operations_unix.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
container_operations_windows.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
container_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
container_windows.go daemon: fix capitalization of some functions 2020-04-14 17:22:19 +02:00
content.go gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
create.go Lock down docker root dir perms. 2021-08-19 20:40:15 +00:00
create_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
create_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
create_windows.go Entropy cannot be saved 2019-06-07 11:54:45 +01:00
daemon.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
daemon_linux.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
daemon_linux_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
daemon_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
daemon_unix.go gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
daemon_unix_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
daemon_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
daemon_windows.go Windows: Re-create custom NAT networks after restart if missing from HNS 2022-07-25 03:29:01 -07:00
daemon_windows_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
debugtrap_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
debugtrap_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
debugtrap_windows.go daemon: rename all receivers to "daemon" 2020-04-14 17:22:21 +02:00
delete.go vendor: opencontainers/selinux v1.8.0, and remove selinux build-tag and stubs 2020-12-24 00:47:16 +01:00
delete_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
dependency.go Add canonical import comment 2018-02-05 16:51:57 -05:00
devices_linux.go Add DeviceRequests to HostConfig to support NVIDIA GPUs 2019-03-18 17:19:45 +00:00
disk_usage.go Extract volume interaction to a volumes service 2018-05-25 14:21:07 -04:00
errors.go Error string match: do not match command path 2021-04-27 18:46:33 +00:00
events.go Remove SystemInfo() error handling. 2019-08-29 07:44:39 +08:00
events_test.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
exec.go [20.10 backport] daemon: kill exec process on ctx cancel 2022-08-23 22:30:01 +02:00
exec_linux.go oci: inheritable capability set should be empty 2022-03-17 14:17:00 -07:00
exec_linux_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
exec_windows.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
export.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
health.go daemon: rename all receivers to "daemon" 2020-04-14 17:22:21 +02:00
health_test.go daemon: suppress logs in unit tests 2019-10-18 00:57:56 +02:00
info.go Update documentation links 2021-02-25 21:54:39 +01:00
info_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
info_unix.go gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
info_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
info_windows.go Make cgroup namespaces configurable 2019-05-07 10:22:16 -07:00
inspect.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
inspect_linux.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
inspect_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
inspect_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
keys.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
keys_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
kill.go docker kill: fix bug where failed kills didnt fallback to unix kill 2021-10-20 22:33:15 +00:00
licensing.go Expose license status in Info (#37612) 2018-08-17 17:05:21 -07:00
licensing_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
links.go Add canonical import comment 2018-02-05 16:51:57 -05:00
list.go daemon: var-declaration: should omit type bool (revive) 2022-08-17 18:12:41 +02:00
list_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
list_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
list_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
logdrivers_linux.go Support configuration of log cacher. 2020-02-19 17:02:34 -05:00
logdrivers_windows.go Support configuration of log cacher. 2020-02-19 17:02:34 -05:00
logs.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
logs_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
metrics.go daemon: use RWMutex for stateCounter 2022-03-25 09:38:53 +01:00
metrics_unix.go set ReadHeaderTimeout to address G112: Potential Slowloris Attack (gosec) 2023-02-24 17:05:42 -05:00
metrics_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
monitor.go handleContainerExit: put a timeout on containerd DeleteTask 2020-11-14 15:23:29 -08:00
mounts.go daemon: daemon.prepareMountPoints(): fix panic if mount is not a volume 2023-07-07 16:02:17 -04:00
names.go Entropy cannot be saved 2019-06-07 11:54:45 +01:00
network.go replace golint with revive, as it's deprecated 2023-02-24 17:05:41 -05:00
network_windows.go daemon.getEndpointInNetwork() is only used on Windows 2019-09-18 12:55:46 +02:00
nvidia_linux.go goimports: fix imports 2019-09-18 12:56:54 +02:00
oci_linux.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
oci_linux_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
oci_utils.go goimports: fix imports 2019-09-18 12:56:54 +02:00
oci_windows.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
oci_windows_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
pause.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
prune.go API: add "prune" events 2020-07-28 12:41:14 +02:00
reload.go Adding ability to change max download attempts 2019-09-19 13:51:40 +02:00
reload_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
reload_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
reload_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
rename.go docker rename enhancement 2018-09-21 09:43:06 +08:00
resize.go Merge pull request #38522 from cpuguy83/fix_timers 2019-06-07 13:16:46 +02:00
resize_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
restart.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
runtime_unix.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
runtime_windows.go Add shim config for custom runtimes for plugins 2021-02-17 21:20:03 +01:00
seccomp_disabled.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
seccomp_linux.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
seccomp_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
secrets.go Add canonical import comment 2018-02-05 16:51:57 -05:00
secrets_linux.go Add canonical import comment 2018-02-05 16:51:57 -05:00
secrets_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
secrets_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
start.go Don't set image on containerd container. 2020-11-06 04:55:03 +00:00
start_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
start_windows.go Configure shims from runtime config 2020-07-13 14:18:02 -07:00
stats.go Merge pull request #40478 from cpuguy83/dont-prime-the-stats 2020-04-16 20:57:06 +02:00
stats_collector.go Add canonical import comment 2018-02-05 16:51:57 -05:00
stats_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
stats_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
stop.go Fix log statement 'failed to exit' timeout accuracy 2021-10-20 22:35:44 +00:00
top_unix.go reformat "nolint" comments 2022-08-17 18:12:14 +02:00
top_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
top_windows.go gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
trustkey.go Allow system.MkDirAll() to be used as drop-in for os.MkDirAll() 2019-08-08 15:05:49 +02:00
trustkey_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
unpause.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
update.go Fix for lack of syncromization in daemon/update.go 2022-01-20 09:55:17 +01:00
update_linux.go goimports: fix imports 2019-09-18 12:56:54 +02:00
update_windows.go Windows: Experimental: Allow containerd for runtime 2019-03-12 18:41:55 -07:00
util_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
volumes.go [20.10] Backport Restore active mount counts on live-restore 2023-06-28 18:48:30 +00:00
volumes_linux.go Fix the several typos detected by github.com/client9/misspell 2018-08-09 00:45:00 +09:00
volumes_linux_test.go daemon: rename variables that collide with imported package names 2020-04-14 17:22:23 +02:00
volumes_unit_test.go Move mount parsing to separate package. 2018-04-19 06:35:54 -04:00
volumes_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
volumes_unix_test.go staticcheck: SA4001: &*x will be simplified to x. It will not copy x 2022-08-17 18:10:19 +02:00
volumes_windows.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
wait.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
workdir.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00