Skip to content

Commit 2b4ae94

Browse files
author
Christian Weichel
committed
[ws-daemon] Support umount proc
1 parent 7cc8e52 commit 2b4ae94

File tree

22 files changed

+881
-137
lines changed

22 files changed

+881
-137
lines changed

components/workspacekit/pkg/seccomp/notify.go

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,26 @@ func (h *InWorkspaceHandler) Umount(req *libseccomp.ScmpNotifReq) (val uint64, e
300300
}
301301

302302
if _, ok := procMounts[target]; ok {
303-
fd, err := syscallOpenTree(unix.AT_FDCWD, target, flagAtRecursive|flagOpenTreeClone)
304-
if err != nil {
305-
log.WithError(err).Error("cannot open_tree proc mount")
306-
return Errno(unix.EFAULT)
307-
}
308-
309-
err = unix.Close(int(fd))
310-
if err != nil {
311-
log.WithError(err).Error("cannot close proc mount fd")
312-
return Errno(unix.EFAULT)
313-
}
314-
315-
log.WithField("target", target).Info("umounted proc mount")
316-
return 0, 0, 0
303+
// ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
304+
// defer cancel()
305+
// _, err = h.Daemon.UmountProc(ctx, &daemonapi.UmountProcRequest{
306+
// Target: target,
307+
// Pid: int64(req.Pid),
308+
// })
309+
// if err != nil {
310+
// log.WithError(err).Error("cannot umount proc mount")
311+
// return Errno(unix.EFAULT)
312+
// }
313+
314+
// log.WithField("target", target).Info("umounted proc mount")
315+
// return 0, 0, 0
316+
317+
// proc umounting doesn't work yet from ws-daemon. Instead EPERM here.
318+
// In most cases that's not a problem because in-workspace proc mounts
319+
// usually happen within a mount namespace anyways, for which the kernel
320+
// lazy umounts everything that's just attached within that namespace.
321+
// TODO(cw): make proc umounting work in ws-dameon.
322+
return Errno(unix.EPERM)
317323
}
318324

319325
var isProcMountChild bool

components/workspacekit/pkg/seccomp/opentree.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

components/ws-daemon-api/go/workspace.pb.go

Lines changed: 159 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)