Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrBaS-0001Ad-3f for qemu-devel@nongnu.org; Mon, 15 Mar 2010 10:48:08 -0400 Received: from [199.232.76.173] (port=43690 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrBaR-0001AV-Jf for qemu-devel@nongnu.org; Mon, 15 Mar 2010 10:48:07 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrBaP-0003Oj-L1 for qemu-devel@nongnu.org; Mon, 15 Mar 2010 10:48:07 -0400 Received: from afflict.kos.to ([92.243.29.197]:44557) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NrBaP-0003OV-85 for qemu-devel@nongnu.org; Mon, 15 Mar 2010 10:48:05 -0400 Date: Mon, 15 Mar 2010 14:48:03 +0000 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH 0/6] Multi-level page tables and userland mapping fixes, v3 Message-ID: <20100315144803.GA1895@afflict.kos.to> References: <4B9B9A94.4000700@opensuse.org> <20100315074556.GA1261@afflict.kos.to> <201003151346.10470.dl9pf@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201003151346.10470.dl9pf@gmx.de> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan-Simon =?utf-8?Q?M=C3=B6ller?= Cc: Martin Mohring , Riku Voipio , qemu-devel@nongnu.org, Aurelien Jarno , Richard Henderson On Mon, Mar 15, 2010 at 01:46:10PM +0100, Jan-Simon M=C3=B6ller wrote: > We're still investigating the topic. So far, we tracked one failure dow= n to > ldconfig.real which is a static arm binary executed after the chroot go= t the=20 > basic packages installed. If we setup a chroot with an older qemu-arm a= nd=20 > exchange it afterwards with the new qemu and rerun just the build step,= it=20 > works. Thus it seems to be an issue with static arm binaries atm. >=20 > Strace of a call of ldconfig.real with the qemu-arm failing: >=20 > http://pastie.org/870189 >=20 > Sort version: >=20 > root@frodo:/# qemu-arm -strace /sbin/ldconfig.real =20 > 16359 uname(0x403fef78) =3D 0 =20 > 16359 brk(NULL) =3D 0x000a9000 =20 > 16359 brk(0x000a9d08) =3D 0x000a9d08 =20 > 16359 open("/dev/urandom",O_RDONLY) =3D 3 =20 > 16359 read(3,0x403ff27d,3) =3D 3 =20 > 16359 close(3) =3D 0 =20 > [...] > 16359 stat64("/usr/lib/libgettextlib.so",0x403fdf28) =3D 0 > 16359 stat64("/usr/lib/libgettextpo.so.0",0x403fdec0) =3D 0 > 16359 stat64("/usr/lib/libgettextpo.so.0.4.0",0x403fdf28) =3D 0 > 16359 stat64("/usr/lib/libpython2.6.so.1.0",0x403fdec0) =3D 0 > 16359 stat64("/usr/lib/libpython2.6.so.1.0",0x403fdf28) =3D 0 > 16359 open("/etc/ld.so.cache~",O_WRONLY|O_CREAT|O_NOFOLLOW|O_TRUNC,0600= ) =3D 3 > 16359 write(3,0xb03d0,1288) =3D 1288 > 16359 write(3,0x403ff0a0,0) =3D -1 errno=3D14 (Bad address) A zero sized write. According to manpage ok.=20 In qemu we do a lock_user to to get the string to write. Richards change = changes the access checks the get called by lock_user: page_check_range: - if (start + len < start) - /* we've wrapped around */ ... + if (start + len - 1 < start) { + /* We've wrapped around. */ This now blows up with len =3D 0; > 16359 write(2,0x403fca08,21)/sbin/ldconfig.real: =3D 21 > 16359 write(2,0x403fc9e8,28)Writing of cache data failed =3D 28 > 16359 write(2,0x403fc5b8,13): Bad address =3D 13 > 16359 write(2,0x403fc9c0,1) > =3D 1 > 16359 exit_group(1) >=20 > Best, > Jan-Simon >=20