Skip to content

Race condition in fuse mount on Ubuntu 26.04 #1032

Description

@tpasternak-engflow

Repro steps:

  1. Use Ubuntu 26.04
  2. Run for i in $(seq 1 100); do docker run --rm --runtime=sysbox-runc debian/latest /bin/true& done

Observed results:

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: failed to pre-register with sysbox-fs: failed to pre-register container with sysbox-fs: rpc error: code = Internal desc = Initialization error for container-id

journalctl -u sysbox-fs.service contains lines:

mount helper error: fusermount3: file descriptor 3 is not a socket, can't send fuse fd

Affected versions:

Confirmed on 0.7.0 and 0.7.1

Early investigation:

It seems that something weird happen between these lines:

	fds, err := syscall.Socketpair(syscall.AF_UNIX, syscall.SOCK_STREAM, 0)
	if err != nil {
		return nil, fmt.Errorf("socketpair error: %v", err)
	}


	writeFile := os.NewFile(uintptr(fds[0]), "fusermount-child-writes")
	defer writeFile.Close()


	readFile := os.NewFile(uintptr(fds[1]), "fusermount-parent-reads")
	defer readFile.Close()


	cmd := exec.Command(
		"fusermount3",
		"-o", conf.getOptions(),
		"--",
		dir,
	)
	cmd.Env = append(os.Environ(), "_FUSE_COMMFD=3")

Most likely, syscall.Socketpair returns an incorrect fd, or it initializes it lazily

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions