https://www.dragonflybsd.org/~tkusumi/diff/freebsd/0001-ufs-ext2-Fix-vop_readdir-s-ncookies-handling.patch https://github.com/kusumi/freebsd-src/commits/ncookies_1 This should be updating ncookies pointer value, not the pointer itself. Callers in NFS are passing int variable in stack.
I will get the fix committed.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e84e44215fe19dad4d1779d5ee0b2f2d2739f016 commit e84e44215fe19dad4d1779d5ee0b2f2d2739f016 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2023-01-02 03:29:43 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2023-01-02 03:30:14 +0000 Fix vop_readdir's ncookies handling in UFS and EXT2. Submitted by: Kusumi Tomohiro PR: 267706 MFC after: 1 week sys/fs/ext2fs/ext2_lookup.c | 2 +- sys/ufs/ufs/ufs_vnops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=caf4d617945efea8c59443d8ab184c288bae43be commit caf4d617945efea8c59443d8ab184c288bae43be Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2023-01-02 03:29:43 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2023-01-14 18:48:48 +0000 Fix vop_readdir's ncookies handling in UFS and EXT2. Submitted by: Kusumi Tomohiro PR: 267706 (cherry picked from commit e84e44215fe19dad4d1779d5ee0b2f2d2739f016) sys/fs/ext2fs/ext2_lookup.c | 2 +- sys/ufs/ufs/ufs_vnops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
MFC'ed to 13.