From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvWsl-0005YD-FN for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:48:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvWsg-0005Rj-Gf for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:48:42 -0400 Received: from [199.232.76.173] (port=38957 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvWsg-0005RZ-5T for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:48:38 -0400 Received: from qw-out-1920.google.com ([74.125.92.147]:6248) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvWsf-0007cE-Om for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:48:37 -0400 Received: by qw-out-1920.google.com with SMTP id 5so1615748qwc.4 for ; Wed, 07 Oct 2009 06:48:37 -0700 (PDT) Message-ID: <4ACC9C30.2080505@codemonkey.ws> Date: Wed, 07 Oct 2009 08:48:32 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <200909212039.01126.rusty@rustcorp.com.au> <4AB7A01A.3000206@redhat.com> <4AB8992B.7070709@redhat.com> <4AB8DD53.7070806@redhat.com> <4AB8DECA.3090908@redhat.com> <4AB8E88C.4040103@redhat.com> <4AB980E6.2070203@codemonkey.ws> <4AB9AA8E.7060800@third-harmonic.com> <4AC1A4AD.10509@redhat.com> <4ACA1527.9050305@third-harmonic.com> <20091005195409.GB3399@redhat.com> <4ACC2BE6.2080205@redhat.com> In-Reply-To: <4ACC2BE6.2080205@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] fix virtio_blk serial pci config breakage, v2 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: john cooper Cc: "Michael S. Tsirkin" , Rusty Russell , qemu-devel@nongnu.org, Vadim Rozenfeld , jens.axboe@oracle.com, Avi Kivity john cooper wrote: > Michael S. Tsirkin wrote: > >>> + put_le16(p + 0, 0x0); /* ATA device */ >>> + padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware revision */ >>> >> QEMU version is currently a string like "0.11.50" which is exactly 8 >> bytes. What if someone makes it longer? padstr will not 0 >> terminate string, and only partial data will be there. >> > > This code treats the field similar to the logic from which > it derives (hw/ide.c) in that the field need not be nul > terminated. Quiet truncation to 8 bytes can occur here > and in the existing usage but in a practical sense I don't > see much of a recourse. We can flag a warning but the > data is realistically a best-effort attempt to provide > relevant information in this field. IOW overflowing > this field probably isn't justification alone to modify > a too long qemu version string. > Hrm, we really shouldn't be exposing a version string to the guest in the first place. That's a compatibility issue. Really, I strongly dislike passing this identity page via virtio. Why are we still going this route instead of just passing the S/N? Regards, Anthony Liguori