git: b4f610a6851d - main - vfs: Handle zero-length directory reads
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 23 Jul 2025 17:34:31 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=b4f610a6851d9dcb54ada397c5dc93ab2e8559e1
commit b4f610a6851d9dcb54ada397c5dc93ab2e8559e1
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-23 17:33:11 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-23 17:34:13 +0000
vfs: Handle zero-length directory reads
Avoid a false-positive assertion in VOP_READDIR in that case.
Reported by: syzbot+4689a0b0d5918a8e3bc4@syzkaller.appspotmail.com
Fixes: 77b273d8f5f4 ("vfs: Assert that VOP_READDIR sets *eofflag properly")
---
sys/sys/vnode.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index c4944965a484..a416fddcddc3 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1023,7 +1023,8 @@ void vop_rename_fail(struct vop_rename_args *ap);
#define vop_readdir_post_assert(ap, ret) \
nresid = (ap)->a_uio->uio_resid; \
if ((ret) == 0 && (ap)->a_eofflag != NULL) { \
- VNASSERT(nresid != oresid || *(ap)->a_eofflag == 1, \
+ VNASSERT(oresid == 0 || nresid != oresid || \
+ *(ap)->a_eofflag == 1, \
(ap)->a_vp, ("VOP_READDIR: eofflag not set")); \
}
#else