From nobody Mon May 01 16:19:33 2023 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 4Q97hQ2fswz48jc3 for ; Mon, 1 May 2023 16:19:34 +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 4Q97hQ0srkz3xft for ; Mon, 1 May 2023 16:19:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682957974; 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=BbjZgXxp0c9IwnESND5f/owY3pSzGuLF9kY6svGzapI=; b=J6upf56jhyUwcO7/g3hwM4BgIE4nwRa5kjZrZpz1r2GKmUnuQVmo6L4PPGV8mk/Fz8J+Bq 0UuJIcaj/bMN+4Sm79xWJz6MjCR14XmqEmzhF4zDWcVVYoa0XOQnkiS+fEzQQBLwZNX+Hb EABlofHota7BfgeICgXQ4Qu64aY+tiDs4B7j+fiTevWOTYzHrNDIeQNyNmIqZ0AjkXkDjn cuDaezxSX5skY4jv3evZpy/oT0lTMxU6NXaENKiO/GlVymfLWk4ZDvxrJ2ARDkSGTOu1qI NbNUzRa4onslNo8WT/+W7iMz3sdIl206ZW8cRXa3BwfcymnchOyOjae0X4vE2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682957974; a=rsa-sha256; cv=none; b=jZgBh61bi+AbbCM3qWT1NZ800exg/5YndYveuk5R6d+e3/OBAY/4Xj1ayuyYfsLLz8COsV /7tkjF/zqxrnHOdVlSt2rslfAXxMnZlBZHHNGLSt+CzsJG1bEqWUhGixZx5LxjO+f3zvZB 8J7y9CZskiHnzsjbk3SVcOkofpjxJGMO5EdjGsesEDxOSf4O2Fc48EMb9v+Mxt3ZUbdvTw oUNtmfkaYGvDf4kg7LzVAsQd5WIhApgQBdmU+JVJsCRJ9tCrQ7sijxLxVMoDciTk60CEDZ MvdRtRBzaJaWN5Wz5MfIaw42aCRjh+rHtxsfpq+R7TifI1prLw78fCWA32YlWg== 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 4Q97hP6ywMz1BL6 for ; Mon, 1 May 2023 16:19:33 +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 341GJXEg057103 for ; Mon, 1 May 2023 16:19:33 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 341GJXQA057102 for bugs@FreeBSD.org; Mon, 1 May 2023 16:19:33 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 271174] NFS readdir truncates dirent fileid to 32 bits Date: Mon, 01 May 2023 16:19:33 +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: 12.4-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bmueller@panasas.com 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271174 Bug ID: 271174 Summary: NFS readdir truncates dirent fileid to 32 bits Product: Base System Version: 12.4-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: bmueller@panasas.com The return result of an NFS readdir rpc include directory entries (dirents)= .=20 According to NFSv3 RFC, the struct entry3 (which represent the dirents) contains type fileid3 for the fileid. fileid3 is a 64 bit number. However, we can see that in the FreeBSD kernel NFS server, when assembling = the dirent, the server only marshalls 32 bits of the d_fileno: https://github.com/freebsd/freebsd-src/blob/main/sys/fs/nfsserver/nfs_nfsdp= ort.c#L2259. This results in the lower 32 bits of the fileno being transmitted. This manifests as a problem with the libc getcwd call because under some circumstances, getcwd wants to manually determine the cwd by doing a series= of readdirs, comparing the inode number (fileid) from the direntries with a st= at of the current directory. Stat (NFS getattr) will return a 64 bit fileid, = but the readdir will be 32 bits, so the comparison never matches and getcwd fai= ls. The NFS server can be fixed by doing 64 bit fileid marshalling for NFSv3/4, while leaving it as 32 bits for NFSv2 where fileid. --=20 You are receiving this mail because: You are the assignee for the bug.=