Received: from eggs.gnu.org ([208.118.235.92]:57622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXsSt-0002JF-RZ for qemu-devel@nongnu.org; Mon, 12 Nov 2012 06:46:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXsSq-0000NP-PF for qemu-devel@nongnu.org; Mon, 12 Nov 2012 06:46:07 -0500 Received: from mono.eik.bme.hu ([2001:738:2001:2001::2001]:41034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXsSq-0000Mn-I6 for qemu-devel@nongnu.org; Mon, 12 Nov 2012 06:46:04 -0500 Date: Mon, 12 Nov 2012 12:45:55 +0100 (CET) From: BALATON Zoltan In-Reply-To: <50A0C260.70408@redhat.com> Message-ID: References: <509D059F.9000809@redhat.com> <201211100045.39497.marex@denx.de> <50A0C260.70408@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [Qemu-devel] [PATCH] ui/vnc.c: Fix crash with VNC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Marek Vasut , Gerhard Wiesinger , Anthony Liguori , qemu-devel@nongnu.org, Peter Maydell On Mon, 12 Nov 2012, Gerd Hoffmann wrote: > On 11/10/12 00:45, Marek Vasut wrote: >> Dear Gerd Hoffmann, >> >>> On 11/09/12 10:50, Peter Maydell wrote: >>>> On 9 November 2012 10:42, Anthony Liguori wrote: >>>>> While the abstract discussion is fun, it never hurts to be defensive. I >>>>> agree the root cause is vmware-vga but checking in vnc doesn't hurt. >>>> >>>> Defensive programming would suggest doing the clipping in the >>>> console.c layer. That sounds a reasonable plan to me (especially >>>> if we've hit similar problems multiple times in the past). >>> >>> Fully agree, I'll cook up a patch as I'm touching that anyway. >>> >>> Question is just whenever we'll go silently fixup stuff in console.c or >>> use assert()s to enforce callers getting this correct. I'd tend to use >>> assert() as vmware-vga passing bogous stuff there IMHO indicates there >>> is a bug in vmware-vga. >> >> Or rather some revisions of the guest X driver. Though it's worth investigating >> it in the right place indeed. > > That too, but we must add a check to qemu nevertheless. We can't trust > the guest to not pass in bogous data, be it intentionally or by mistake. > vmware-vga must sanity check the guest input no matter what, but > validating the guests input once should be enougth. For vmware_vga you could take this: http://patchwork.ozlabs.org/patch/197904/ or modify it/come up with a similar patch as needed. Regards, BALATON Zoltan