From nobody Thu Jun 09 11:14:12 2022 X-Original-To: bugs@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 3F6FB839204 for ; Thu, 9 Jun 2022 11:14:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LJhLX5BMFz56hy for ; Thu, 9 Jun 2022 11:14:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9380B2313F for ; Thu, 9 Jun 2022 11:14:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 259BECOi064735 for ; Thu, 9 Jun 2022 11:14:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 259BECcA064734 for bugs@FreeBSD.org; Thu, 9 Jun 2022 11:14:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 264570] nfsuserd: Mapping of Userids mismatched Date: Thu, 09 Jun 2022 11:14:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: georg-bsd@schorsch-tech.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654773253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1q6yJrBrpmk7rrEIj8iQYUXCQ3vf3Egmzghn9CzeV9o=; b=jBoMEyDZITUGFn1nTYErxkoCAUv9Qa0AabXTgZ+U/6XUh2xzClmDxC1vVnUNmW7MA/mjwO TGMmk0EkGozJWXoTo1qUQn5FLl4i+4uEdPt2aXFcBoBkTa/1EdcFW+glGRwIXzJWnNjRin aBzH5snF1TAHpOmYD+4889oB+rLBOVqxefZ+FgFTYESOYWrYp302ctNzLOuySsUgv2E7bQ Jj5XjK1joqRTt2N64rgZFT3l6ZnC+thGHscXeRCgmL3VPVWisn+o0REjWAZMApvd7K/QGq 8z1emJUFJj3OORfsD5ZpIMYIH3/RGRzfYiY62UiAGA1+O0uE37hvN/LvEZ/7Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654773253; a=rsa-sha256; cv=none; b=oG4SnuajKoaA3O0U5uB8ZP1hE6dslxPSU1taCVdamWF/HAYZSCJ+qsZXSXrfNjDTpmEsTh TxBpdyv0EIHsCeSUcCHLihZGFpPiW6kuh0VbVWbvS7b2qwopz4QhqViJaOeh7VpDoqWRaO 8jz0c299cElnHkgkxGASgICgsUeMv4FQvWRtVJPC4avXkhIvV/+0CsK59QNo3Fh+aZDNAP WOavZ0CQyz+27+gKHDq2mc1Coh45JWQO68FiopWbJUjMB7f8gzoaz6CLKxoMPRIwcxEXo1 t+IQ0P0krPXzeZ4ZfxiM6g1Z0dL3jF0jDeoqE1p9lj6N58K7Tkqs3W5OXqrV7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264570 Bug ID: 264570 Summary: nfsuserd: Mapping of Userids mismatched Product: Base System Version: 13.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: georg-bsd@schorsch-tech.de I got 2 fresh installed 13.1-RELEASE VMs in bhyve. fs (nfs server) admin: uid 1001 u1 : uid 1002 u2 : uid 1003 fc (nfs client) admin: uid 1001 u1 : uid 1003 u2 : uid 1002 I intentionally crossed the u1 and u2 uids on these two accounts to test the nfsuserd. Settings on the server =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D admin@fs:~ # id u1 uid=3D1002(u1) gid=3D1002(u1) groups=3D1002(u1) admin@fs:~ # id u2 uid=3D1003(u2) gid=3D1003(u2) groups=3D1003(u2) admin@fs:~ $ hostname -f fs.me.local admin@fs:~ $ ls -la /zroot/nfsv4/test/ total 3 drwxr-xr-x 2 root wheel 5 Jun 7 17:46 . drwxr-xr-x 3 root wheel 3 Jun 7 17:46 .. -rw-r--r-- 1 admin wheel 0 Jun 7 17:46 hallo_admin -rw-r--r-- 1 u1 u1 0 Jun 7 17:46 hallo_u1 -rw-r--r-- 1 u2 u2 0 Jun 7 17:46 hallo_u2 admin@fs:~ $ cat /etc/rc.conf hostname=3D"fs.me.local" keymap=3D"de.kbd" ifconfig_vtnet0=3D"DHCP" ifconfig_vtnet0_ipv6=3D"inet6 accept_rtadv" sshd_enable=3D"YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev=3D"NO" zfs_enable=3D"YES" nfs_server_enable=3D"YES" nfsv4_server_enable=3D"YES" nfs_client_enable=3D"YES" nfsuserd_enable=3D"YES" nfsuserd_flags=3D"-domain me.local -verbose" nfscbd_enable=3D"YES" mountd_enable=3D"YES" mountd_flags=3D"-r" hostid_enable=3D"YES" admin@fs:~ $ cat /etc/exports /zroot/nfsv4/test -alldirs -network 192.168.160.0/24 V4: /zroot/nfsv4 -sec=3Dsys -network 192.168.160.0/24 sysctl.conf vfs.nfs.enable_uidtostring=3D1 vfs.nfsd.enable_stringtouid=3D0 Settings on the client =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D root@fc:~ # id u1 uid=3D1003(u1) gid=3D1003(u1) groups=3D1003(u1) root@fc:~ # id u2 uid=3D1002(u2) gid=3D1002(u2) groups=3D1002(u2) root@fc:~ # hostname -f fc.me.local root@fc:~ # mount -t nfs -o nfsv4 192.168.160.66:/test /mnt root@fc:~ # nfsstat -m 192.168.160.66:/test on /mnt nfsv4,minorversion=3D2,tcp,resvport,nconnect=3D1,hard,cto,sec=3Dsys,acdirmi= n=3D3,acdirmax=3D60,acregmin=3D5,acregmax=3D60,nametimeo=3D60,negnametimeo= =3D60,rsize=3D65536,wsize=3D65536,readdirsize=3D65536,readahead=3D1,wcommit= size=3D8388608,timeout=3D120,retrans=3D2147483647 root@fc:~ # ls -la /mnt/ total 11 drwxr-xr-x 2 root wheel 5 Jun 7 17:46 . drwxr-xr-x 19 root wheel 25 Jun 7 17:44 .. -rw-r--r-- 1 admin wheel 0 Jun 7 17:46 hallo_admin -rw-r--r-- 1 u2 u2 0 Jun 7 17:46 hallo_u1 -rw-r--r-- 1 u1 u1 0 Jun 7 17:46 hallo_u2 root@fc:~ # rc.conf: -------- hostname=3D"fc.me.local" keymap=3D"de.kbd" ifconfig_vtnet0=3D"DHCP" ifconfig_vtnet0_ipv6=3D"inet6 accept_rtadv" sshd_enable=3D"YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev=3D"NO" zfs_enable=3D"YES" nfs_client_enable=3D"YES" nfsuserd_enable=3D"YES" nfsuserd_flags=3D"-domain me.local -verbose" nfscbd_enable=3D"YES" rpc_lockd_enable=3D"YES" rpc_statd_enable=3D"YES" mountd_flags=3D"-r" hostid_enable=3D"YES" sysctl.conf vfs.nfs.enable_uidtostring=3D1 vfs.nfsd.enable_stringtouid=3D0 Test: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D On the client i mounted with: mount -t nfs -o nfsv4 fs:/test /mnt root@fc:/mnt # ls -la total 11 drwxr-xr-x 2 root wheel 5 Jun 7 17:46 . drwxr-xr-x 19 root wheel 25 Jun 8 05:50 .. -rw-r--r-- 1 admin wheel 0 Jun 7 17:46 hallo_admin -rw-r--r-- 1 u1 u1 0 Jun 7 17:46 hallo_u1 -rw-r--r-- 1 u2 u2 0 Jun 7 17:46 hallo_u2 This looks good! But the problem is: I created on the server in the /zroot/nfsv4/test a nuew subfolder "sub" with u+w,g+w,o+w. In this folder i= try to create a new file. On the client: u1@fc:~ $ touch /mnt/sub/hello_feom_client_u1 u1@fc:~ $ ls -la /mnt/sub/ total 2 drwxr-xrwx 2 u2 u2 3 Jun 8 18:04 . drwxrwxr-x 3 u2 u2 6 Jun 8 06:07 .. -rw-r--r-- 1 u1 u2 0 Jun 8 18:04 hello_feom_client_u1 u1@fc:~ $ ls -ln /mnt/sub/ total 1 -rw-r--r-- 1 1003 1002 0 Jun 8 18:04 hello_feom_client_u1 And the server shows: admin@fs:~ $ sudo ls -la /zroot/nfsv4/test/sub/ total 3 drwxr-xrwx 2 u1 u1 3 Jun 8 18:04 . drwxrwxr-x 3 u1 u1 6 Jun 8 06:07 .. -rw-r--r-- 1 u2 u1 0 Jun 8 18:04 hello_feom_client_u1 admin@fs:~ $ sudo ls -ln /zroot/nfsv4/test/sub/ total 1 -rw-r--r-- 1 1003 1002 0 Jun 8 18:04 hello_feom_client_u1 Please see the mismatched uids! I touch the file as u1 on the client. The client u1 "ls -la" shows that the new file is from u2. And also on the serv= er the new file is from u2. I dont run any NIS, LDAP or kerberos. Also the version used is NFS4.2. I tr= ied to downgrade to 4.1 and 4.0 but the behaviour stays the same. I set the two sysctl variables explicit to use the names in the nfs protoc= ol and not the uids that i explicit use nfsuserd and dont rely on the same uid= s on all clients,servers. I read that post from rick: https://forums.freebsd.org/threads/nfsv4-without-kerberos.71899/#post-436567 or better from the mailing list https://www.mail-archive.com/freebsd-stable@freebsd.org/msg139428.html So my question is: Is this a bug or just wrong configured? --=20 You are receiving this mail because: You are the assignee for the bug.=