From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nrrjg-0004zR-5y for qemu-devel@nongnu.org; Wed, 17 Mar 2010 07:48:28 -0400 Received: from [199.232.76.173] (port=42373 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nrrjf-0004z9-ED for qemu-devel@nongnu.org; Wed, 17 Mar 2010 07:48:27 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nrrjd-0003P2-V4 for qemu-devel@nongnu.org; Wed, 17 Mar 2010 07:48:27 -0400 Received: from afflict.kos.to ([92.243.29.197]:47207) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nrrjd-0003OH-2v for qemu-devel@nongnu.org; Wed, 17 Mar 2010 07:48:25 -0400 Date: Wed, 17 Mar 2010 11:48:07 +0000 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH 0/6] Multi-level page tables and userland mapping fixes, v3 Message-ID: <20100317114807.GA13278@afflict.kos.to> References: <201003151346.10470.dl9pf@gmx.de> <20100315144803.GA1895@afflict.kos.to> <201003151608.46624.dl9pf@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201003151608.46624.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 04:08:46PM +0100, Jan-Simon M=C3=B6ller wrote: > Am Montag, 15. M=C3=A4rz 2010 15:48:03 schrieb Riku Voipio: > > On Mon, Mar 15, 2010 at 01:46:10PM +0100, Jan-Simon M=C3=B6ller wrote= : > > > root@frodo:/# qemu-arm -strace /sbin/ldconfig.real > > > 16359 uname(0x403fef78) =3D 0 > > > 16359 brk(NULL) =3D 0x000a9000 > > > 16359 brk(0x000a9d08) =3D 0x000a9d08 > > > 16359 open("/dev/urandom",O_RDONLY) =3D 3 > > > 16359 read(3,0x403ff27d,3) =3D 3 > > > 16359 close(3) =3D 0 > > > [...] > > > 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) =20 > > A zero sized write. According to manpage ok. =20 > > In qemu we do a lock_user to to get the string to write. Richards cha= nge > > changes the access checks the get called by lock_user: > > page_check_range: > >=20 > > - if (start + len < start) > > - /* we've wrapped around */ > > ... > > + if (start + len - 1 < start) { > > + /* We've wrapped around. */ > >=20 > > This now blows up with len =3D 0; > Confirmed. A quick test with if (len > 0) around and ldconfig.real run= s. Richard, would you be ok with that change? Or should we rather have expli= cit=20 if (len =3D=3D 0) return 0; ?