Date: Tue, 05 Apr 2005 10:14:16 +0200 From: Uwe Doering <gemini@geminix.org> To: freebsd-security@freebsd.org Subject: Re: FreeBSD Security Advisory FreeBSD-SA-05:02.sendfile Message-ID: <425248D8.1040508@geminix.org> In-Reply-To: <200504050009.j35099Zr068123@freefall.freebsd.org> References: <200504050009.j35099Zr068123@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
FreeBSD Security Advisories wrote: > [...] > a) Download the relevant patch from the location below, and verify the > detached PGP signature using your PGP utility. > > [FreeBSD 4.x] > # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-05:02/sendfile_4.patch > # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-05:02/sendfile_4.patch.asc > [...] The patch file (and CVS, too) contains this: --------------------- cut here ---------------------- --- sys/ufs/ffs/ffs_inode.c 5 Feb 2002 18:35:03 -0000 1.56.2.5 +++ sys/ufs/ffs/ffs_inode.c 11 Mar 2005 14:29:19 -0000 @@ -197,6 +197,7 @@ #endif softdep_setup_freeblocks(oip, length); vinvalbuf(ovp, 0, cred, p, 0, 0); + vnode_pager_setsize(vp, 0); oip->i_flag |= IN_CHANGE | IN_UPDATE; return (ffs_update(ovp, 0)); } --------------------- cut here ---------------------- I wonder, isn't the variable 'vp' actually supposed to be 'ovp' in the added line? Technically they are identical. 'ovp' is assigned from 'vp' once in the variable definition section at the start of the function. However, using 'vp' when calling vnode_pager_setsize() looks a little odd given that anywhere else in this function, including another call to vnode_pager_setsize(), the variable 'ovp' is used instead of 'vp'. I can't tell why 'ovp' was introduced in the first place. Might have historical reasons. But that's how the code currently works. In the MAIN branch as well, according to CVS. So I'd suggest to replace 'vp' with 'ovp' in the patch above, for the sake of clarity and consistency. Uwe -- Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers gemini@geminix.org | http://www.escapebox.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?425248D8.1040508>