projectatomic / docker

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

Fix masking/ignoring relabeling error #382

Closed kolyshkin closed 2 years ago

kolyshkin commented 2 years ago

Commit 317e94be44d64cf0 introduced a local variable err, which masked the err used as a named return value. As a result, any relabeling error (happened in that defer) is not returned, and the caller gets "", nil, moving on to performing a bind mount with empty m.Source argument (which, apparently, results in mounting a current directory).

This can be reproduced by trying to add a bind mount which has no space left (see RHBZ link below for details).

This issue was spotted upstream during the review, and fixed before the merge (see https://github.com/moby/moby/pull/34792#issuecomment-330355030). In this repository, though, it was never fixed.

Fixes: https://bugzilla.redhat.com/1878621

rhatdan commented 2 years ago

LGTM