projectatomic / docker

Docker - the open-source application container engine
http://www.docker.com
Apache License 2.0
81 stars 58 forks source link

Fix bindmount autocreate race #376

Closed kolyshkin closed 4 years ago

kolyshkin commented 4 years ago

When using the mounts API, bind mounts are not supposed to be automatically created.

Before this patch there is a race condition between validating that a bind path exists and then actually setting up the bind mount where the bind path may exist during validation but was removed during mountpooint setup.

This adds a field to the mountpoint struct to ensure that binds created over the mounts API are not accidentally created.

@kolyshkin: port of upstream commit 1caeb79963d3c9f770b23be2f/PR https://github.com/moby/moby/pull/37378

Signed-off-by: Brian Goff cpuguy83@gmail.com Signed-off-by: Kir Kolyshkin kolyshkin@gmail.com

kolyshkin commented 4 years ago

Might help with https://bugzilla.redhat.com/show_bug.cgi?id=1819110

rh-atomic-bot commented 4 years ago

Can one of the admins verify this patch? I understand the following commands:

rhatdan commented 4 years ago

LGTM