From owner-freebsd-emulation@FreeBSD.ORG Mon Jul 28 11:37:23 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7B6B106564A; Mon, 28 Jul 2008 11:37:23 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 2D7428FC18; Mon, 28 Jul 2008 11:37:23 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A575C9.dip.t-dialin.net [84.165.117.201]) by redbull.bpaserver.net (Postfix) with ESMTP id 1461F2E15B; Mon, 28 Jul 2008 13:37:20 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 6999A6B3C1; Mon, 28 Jul 2008 13:37:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1217245036; bh=+wBCjiJGSYf05RVHZwVPMRRUAYtg0acsh MkGF4Q+uic=; h=Message-ID:Date:From:To:Cc:Subject:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Q9YTfZTgBexubee+hSrihcnFaqCKSKmbo74Jwzgp2ETCnSY7HsVrVD12VV1TYacAY qd/xWYT2QrHXBJmwGZggbS9DI5UQh8sbK5JJrgMpsZib1t6r2CoN7IoPmVN5czRJvsE Iin+Ipbyhm75iUljSb7VehpKTW/bsi/de0/O7xnSfmVUX2Q28X/fk9qaEqMy8slOPy1 2k/mVwRguvpKUjZaoeewPw6fAhWpX1UskbVYnWBwnssqtSJekohNirxqMZeTPatgsaY NIGXUvl9vwrYhTUycEbphUyV1QCtUP8PNUlcZl6Dbg2X16PqvzW1/xcK20S1YeQ6IY6 TFCezBg5w== Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id m6SBbGXJ003619; Mon, 28 Jul 2008 13:37:16 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 28 Jul 2008 13:37:15 +0200 Message-ID: <20080728133715.1670576xbp279u04@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 28 Jul 2008 13:37:15 +0200 From: "Alexander Leidinger" To: "Roman Divacky" References: <200807250700.m6P70FSF036132@freefall.freebsd.org> <20080726091045.4c617dc7@deskjail> <20080728085403.58063b2gbchdjtic@webmail.leidinger.net> <20080728102715.GA78842@freebsd.org> In-Reply-To: <20080728102715.GA78842@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.2) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 1461F2E15B.7F977 X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-13.504, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, MIME_QP_LONG_LINE 1.40, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: freebsd-emulation@freebsd.org, Chagin Dmitry Subject: Re: kern/117010: [linux] linux_getdents() get somethinng like buffer overflow X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2008 11:37:23 -0000 Quoting "Roman Divacky" (from Mon, 28 Jul 2008 =20 12:27:15 +0200): > > [snip of technical discussion] > > while I agree with the attitude that it should be fixed properly, we are > in a situation where a simple patch fixes a problem. and the fix is correc= t. > > I think we should just commit Dmitry's patch and then talk about how =20 > to change > linux_getdents() further. I looked at the Linux code and the =20 > alignment is really > +2 for 32bit and +1 for 64 bit as Dmitry's patch does. That's not the alignment, that's some simple but mandatory padding (a =20 comment should be written there what this is, for the "1" it's the =20 null byte of the name, for the second "1" (in the case of using "2"), =20 I don't know yet what it is). I haven't checked yet if the size =20 calculation (which has the wrong macro name ALIGN, it doesn't align, =20 it just used in the align process) does the right thing on 64bit =20 (padding to a 64bit boundary, so that the next entry starts at a 64bit =20 boundary =3D alignment of the structure). > do you guys agree that fixing the problem the simplest/fastest way =20 > now and then > changing other things is the correct way? It may fix the problem of some specific test cases, but I'm not sure =20 it fixes all use cases. I see this as a partial fix to allow people to =20 do some more tests in other areas of the linuxulator while someone is =20 looking into a complete fix. I don't object if you commit it, but =20 don't think dirent is bugfree after this (I would call it a temporary =20 workaround). Bye, Alexander. --=20 A day without sunshine .... is like ... night! http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137