Drop patch 0008 (vfs.usermount=1) once Workspace's image mounts and user unmounts go through DiskArbitration -- or narrow it if AppImage self-mounting still needs it

Aperta
#229 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

Read patches/0008-NextBSD-enable-unprivileged-mounts-vfs.usermount-1.patch and its entry in patches/series; first verify the listed Workspace DiskArbitration work is merged and resolve whether AppImages still require user-run FUSE mounts. Dry-run the mount/eject flow with vfs.usermount=0 on the CI image before removing anything. Done means the acceptance checks pass, including the kernel build and the non-root mount failure, or the issue records a decision to keep or narrow the patch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:storage enhancement

Summary

Remove patches/0008-NextBSD-enable-unprivileged-mounts-vfs-usermount-1.patch (line 8 of patches/series; it flips sys/kern/vfs_mount.c static int usermount = 0 to 1 and CTLFLAG_RW to CTLFLAG_RWTUN, patch lines 56-59) when the reason it exists is gone. The patch's own text, and PR #62 that merged it (2026-08-02, "kernel: enable unprivileged mounts (vfs.usermount = 1) so users can mount AppImages"), say: "This is an interim mechanism. The intended end state is macOS-shaped: Workspace asks diskarbitrationd to mount on the user's behalf, as it does for a .dmg, and no unprivileged-mount policy is needed at all. NextBSD already ships com.apple.DiskArbitration. When that lands this patch should be dropped." (patch :38-42; the PR adds "which is why it is a standalone series entry rather than folded into anything else").

Why

  • Unprivileged mounts are a system-wide policy the desktop needed only because VolumeManager.m runs darling-dmg/fuseiso/squashfuse as the user (:440-441, :656-657, :819-820) and GWUnmountHelper had no privileged unmount path. With nextbsd/nextbsd-userland#198 (D2) (unmount/eject via DA), gershwin-desktop/gershwin-workspace#119 (D3a) (Workspace calls DA) and gershwin-desktop/gershwin-workspace#120 (D3c) (image mounts via DA), the desktop no longer needs it.
  • The kernel already forces MNT_NOSUID|MNT_USER on unprivileged mounts (patch :32-34 citing vfs_mount.c:1644-1648), but the policy also lets any user mount anything the fs allows anywhere they own; DA's model (root daemon, untrusted media nosuid,nodev,noowners, /Volumes owned by the OS) makes that unnecessary.

Design

  • Delete the patch and its series line; sysctl vfs.usermount reads 0 on the next kernel.
  • RWTUN is the only thing an admin loses; if someone wants the old behaviour, vfs.usermount=1 via /etc/sysctl.conf works because launchctl applies it at bootstrap (launchctl.c:2326; the plan's section 8 notes the patch "may not have needed to be a kernel patch"). Document that in the commit.
  • Not affected: Gershwin's stock-FreeBSD target keeps vfs.usermount=1 in gershwin-system/Library/Scripts/SystemPrepare.sh:781; that is their sysctl, not this patch.

Before starting

  • gershwin-desktop/gershwin-workspace#119 (D3a) merged: no sudo and no user-run umount on the NextBSD target
  • gershwin-desktop/gershwin-workspace#120 (D3c) decided and its .iso prototype merged; and gershwin-desktop/gershwin-workspace#120 (D3c)'s answer on AppImage: #62's title says the patch exists "so users can mount AppImages" (Refs #60, #61: FUSEFS baked in). If AppImage runtimes still self-mount via FUSE as the user (nextbsd/nextbsd#460 lists the end-to-end unprivileged mount as untested; linux_file.c:1108-1132 translates Linux mount("fuse.*")), this ticket becomes "keep 0008, or narrow it to fusefs only", not "drop". Record the decision on the epic.
  • CI image boots and the Gershwin NextBSD target's mount/eject flow passes with vfs.usermount=0 set in loader.conf on a patched kernel (dry run before deleting the patch)

Acceptance

  • patches/0008-... removed, patches/series has no line 8 entry for it, kernel builds
  • sysctl vfs.usermount = 0 on the CI boot log
  • as a non-root user on the Gershwin NextBSD target: mounting a .iso from the desktop, ejecting a USB stick and unmounting a network volume all still work (through DA)
  • mount -t tmpfs tmpfs ~/x as a user fails with EPERM (policy actually off)
  • either an AppImage still runs (gershwin-desktop/gershwin-workspace#120 (D3c) path) or this issue is closed with the narrowed/kept decision and a pointer to why

Refs

Plan section 5 (FUSE for AppImage), 7 (#229 (D5)), 8 (sysctl.conf correction). nextbsd-kernel patches/0008-NextBSD-enable-unprivileged-mounts-vfs-usermount-1.patch:4,26-29,32-34,38-44,56-59, #62 (merged PR), #60, #61. nextbsd-userland launchctl.c:2326, nextbsd/nextbsd#460. gershwin-workspace Workspace/VolumeManager.m:440-441,656-657,819-820; gershwin-system Library/Scripts/SystemPrepare.sh:780-781.


Part of nextbsd/nextbsd#471 (E15 Disks, mounts & DiskArbitration). Draft: https://pkgdemon.github.io/nextbsd-e15-tickets.html#d5

Lingua principale
C
Stelle
12
Fork
3
Merge medio
1h 40m
PR unite (30g)
103

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextbsd/nextbsd-kernel

Tutte le issue di nextbsd/nextbsd-kernel

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.