Skip to content

Commit 2484581

Browse files
author
Mrunal Patel
authored
Merge pull request #2035 from cyphar/bindmount-types
specconv: always set "type: bind" in case of MS_BIND
2 parents a0ecf74 + 8296826 commit 2484581

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libcontainer/specconv/spec_linux.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ func createLibcontainerMount(cwd string, m specs.Mount) *configs.Mount {
277277
source := m.Source
278278
device := m.Type
279279
if flags&unix.MS_BIND != 0 {
280-
if device == "" {
281-
device = "bind"
282-
}
280+
// Any "type" the user specified is meaningless (and ignored) for
281+
// bind-mounts -- so we set it to "bind" because rootfs_linux.go
282+
// (incorrectly) relies on this for some checks.
283+
device = "bind"
283284
if !filepath.IsAbs(source) {
284285
source = filepath.Join(cwd, m.Source)
285286
}

0 commit comments

Comments
 (0)