From nobody Fri Jun 18 10:14:24 2021 X-Original-To: freebsd-jail@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1266C5D3944 for ; Fri, 18 Jun 2021 10:15:04 +0000 (UTC) (envelope-from david@schlachter.ca) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G5vtb2qrwz3lDN for ; Fri, 18 Jun 2021 10:15:03 +0000 (UTC) (envelope-from david@schlachter.ca) Received: by mail-qt1-x82c.google.com with SMTP id o19so7096295qtp.5 for ; Fri, 18 Jun 2021 03:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schlachter-ca.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=OxmpVGGqkRLl/4R9PBukPYP+0NxGIcBp5DKF2SNIPQE=; b=Osm0UBtNo0VpaA0zSwDREF//f0iDr/qTv6IXykdE/qYLfuaMo2RhFSAOkbRokY+MDX 2U6KW8JGojYyWQxCBUDyK3UcmgEvQ4So0ucecHvJHf0Y3VfjIGUn5WdzwN3gatPQnUcB RTzOaxpxzId5hFPY1xM/JMu712ko/2j+8/hfJ2k+/OxodQiegG1iuT0hMRe0VaZm7PU5 lof2PZz7DTaULvgXt/igZ92U9jWOOKBqSOUmFNOqlXW2YZ24Lnw25Q+tg2o+oxpYrIlD VDV+Z6wmKJItgIoziulHvwygMvymHGa7qNqHxDdD7Jk5tS2XWLqOmYmN4DG5UNjXqzeh 7a8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OxmpVGGqkRLl/4R9PBukPYP+0NxGIcBp5DKF2SNIPQE=; b=YCzE+PfFflgxyV6EMkm2ThMHiVWlK5PKd63+JXIhSCxaWkHhzsk/8Q0SnaG7iSJbqv MxGIjCLL+vtrcjJya0TJOR5ukHq8/ZEZZVYjRL/F99I+l1P5Cijh4+TA6Gixo0vEoclJ BIre2+qiDVkdfhrXUsbLxh+GGAPwb5Xq/lLqovJUjL91Zt/78Bw8H0QtcmXsiD5bfahx O+jcL+2Kl7M1FWHlqRvIiOqWzCpYF8sIox1ku6yYFDvV68gtr/TlHWgYpXDn4f6PG+wc AaDFdqqoYWClOaXZ6ZWYZVtzUvd9zJyXP+myaxtYz1w25pFpn8DIxxJtJ+ZDNL2rX1K0 yOzA== X-Gm-Message-State: AOAM530+4+p/dV2taHafGRZs93xIDkK/moouxayqyZGbWWSPChr/Nrun bakc6+19CXO7jqt3EVoqcUnn8Zgu41TdOK4sYG8ALsE0FsS2MuIC X-Google-Smtp-Source: ABdhPJwQ+kqo3dguycHG5nnL1vVC2lm8V5gZH4sePMIDNNlbfwC6sgHmM4flqcQ3e9cjhk8HaEE6JnAoVllLD+4tgEE= X-Received: by 2002:ac8:4b4c:: with SMTP id e12mr9862355qts.78.1624011300718; Fri, 18 Jun 2021 03:15:00 -0700 (PDT) List-Id: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 From: David Schlachter Date: Fri, 18 Jun 2021 06:14:24 -0400 Message-ID: Subject: Only root can access a fusefs mount in a jail? To: freebsd-jail@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b0dcec05c5079883" X-Rspamd-Queue-Id: 4G5vtb2qrwz3lDN X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=schlachter-ca.20150623.gappssmtp.com header.s=20150623 header.b=Osm0UBtN; dmarc=none; spf=pass (mx1.freebsd.org: domain of david@schlachter.ca designates 2607:f8b0:4864:20::82c as permitted sender) smtp.mailfrom=david@schlachter.ca X-Spamd-Result: default: False [-0.53 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[schlachter-ca.20150623.gappssmtp.com:s=20150623]; FREEFALL_USER(0.00)[david]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::82c:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-jail@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::82c:from:127.0.2.255]; DMARC_NA(0.00)[schlachter.ca]; NEURAL_SPAM_SHORT(0.97)[0.968]; DKIM_TRACE(0.00)[schlachter-ca.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82c:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-jail] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: Y --000000000000b0dcec05c5079883 Content-Type: text/plain; charset="UTF-8" Hi all, I posted about this in the iocage issues on Github yesterday [1], but I wonder if it's an underlying issue with jails and fusefs. Summary: in a jail, root can mount and use a fusefs filesystem, but non-root users are not able to access it (with appropriate permissions). I'd appreciate any insight on how I could allow regular users to use such a filesystem (mounted by root). Detailed description to reproduce: Create a jail with the options: - allow_mount: 1 - allow_mount_fusefs: 1 - enforce_statfs: 1 On the host, ensure the fusefs kernel module is loaded. In the guest, add an unprivileged user (e.g. UID=1001), then install fusefs-sshfs and use it to mount a remote server: # sshfs -o uid=1001,gid=1001 user@server.tld: /mnt Root is able to ls the mount, add & remove files, etc. root@fuse-jail:~ # ls -la /mnt total 4545 drwxr-x--x 1 user user 84 Jun 17 18:51 . drwxr-xr-x 20 root wheel 25 May 30 22:14 .. -rw------- 1 user user 2867 Apr 9 2019 .bash_history -rw-r--r-- 1 user user 9286 Jun 17 06:00 .bash_profile lrwxr-xr-x 1 user user 52 Jan 23 2020 .bashrc drwx------ 1 user user 12 May 18 12:49 .cache ... However, the unprivileged user cannot, despite being the owner of the directory. user@fuse-jail:~ % ls -la / ... drwxr-x--x 1 user user 84 Jun 17 18:51 mnt ... user@fuse-jail:~ % ls -la /mnt total 0 ls: /mnt: Operation not permitted Expected behaviour is that user can access /mnt. Thanks in advance for any ideas! David [1] https://github.com/iocage/iocage/issues/1261 --000000000000b0dcec05c5079883--