From owner-freebsd-hackers@FreeBSD.ORG Fri May 29 16:53:23 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D31631065680 for ; Fri, 29 May 2009 16:53:23 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 5626E8FC08 for ; Fri, 29 May 2009 16:53:23 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4D85F6D41F; Fri, 29 May 2009 18:53:22 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 273E1844EE; Fri, 29 May 2009 18:53:22 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans References: <23727599.post@talk.nabble.com> <86prdvipwe.fsf@ds4.des.no> <20090527233110.E4243@delplex.bde.org> <86r5yaijef.fsf@ds4.des.no> <20090529210855.V1643@besplex.bde.org> Date: Fri, 29 May 2009 18:53:22 +0200 In-Reply-To: <20090529210855.V1643@besplex.bde.org> (Bruce Evans's message of "Sat, 30 May 2009 02:01:47 +1000 (EST)") Message-ID: <86vdnju9z1.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@FreeBSD.org, Jakub Lach Subject: Re: FYI Lighttpd 1.4.23 /kernel (trailing '/' on regular file symlink) vulnerability X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 16:53:24 -0000 Bruce Evans writes: > Dag-Erling Sm=C3=B8rgrav writes: > % Index: sys/kern/vfs_lookup.c > % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % --- sys/kern/vfs_lookup.c (revision 192899) > % +++ sys/kern/vfs_lookup.c (working copy) > % @@ -147,6 +147,9 @@ > % cnp->cn_flags &=3D ~LOCKSHARED; > % fdp =3D p->p_fd; > % % + /* We will set this ourselves if we need it. */ > % + cnp->cn_flags &=3D ~TRAILINGSLASH; > % + > > Can TRAILINGSLASH ever be set here? Is namei() ever called recursively? "suspenders and a belt" It is hypothetically possible for the caller to have set it. > % /* > % * Get a buffer for the name to be translated, and copy the > % * name into the buffer. > % @@ -533,6 +536,8 @@ > % if (*cp =3D=3D '\0') { > % trailing_slash =3D 1; > > I thought at first that this flag can go away. I intend to remove it later - I just wanted to get the bug fixed first. I'm happy to hear that removing it will fix the two bugs introduced by the patch I committed :) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no