Date: Mon, 14 Mar 2005 16:21:32 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/fs/pseudofs pseudofs_vnops.c Message-ID: <200503141621.j2EGLXxb068433@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
des 2005-03-14 16:21:32 UTC FreeBSD src repository Modified files: sys/fs/pseudofs pseudofs_vnops.c Log: Fix two long-standing bugs in pfs_readdir(): Since we used an sbuf of size resid to accumulate dirents, we would end up returning one byte short when we had enough dirents to fill or exceed the size of the sbuf (the last byte being lost to bogus NUL termination) causing the next call to return EINVAL due to an unaligned offset. This went undetected for a long time because I did most of my testing in single-user mode, where there are rarely enough processes to fill the 4096-byte buffer ls(1) uses. The most common symptom of this bug is that tab completion of /proc or /compat/linux/proc does not work properly when many processes are running. Also, a check near the top would return EINVAL if resid was smaller than PFS_DELEN, even if it was 0, which is frequently the case and perfectly allowable. Change the test so that it returns 0 if resid is 0. MFC after: 2 weeks Revision Changes Path 1.52 +13 -11 src/sys/fs/pseudofs/pseudofs_vnops.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503141621.j2EGLXxb068433>