From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTuNJ-0005ij-Vh for qemu-devel@nongnu.org; Fri, 25 Nov 2011 06:55:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTuNI-0003JR-RX for qemu-devel@nongnu.org; Fri, 25 Nov 2011 06:55:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTuNI-0003JN-I4 for qemu-devel@nongnu.org; Fri, 25 Nov 2011 06:55:24 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAPBtN3k032194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 25 Nov 2011 06:55:23 -0500 Message-ID: <4ECF8229.8000805@redhat.com> Date: Fri, 25 Nov 2011 12:55:21 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1322219182-18502-1-git-send-email-pbonzini@redhat.com> <4ECF8264.7020606@redhat.com> In-Reply-To: <4ECF8264.7020606@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.0] qiov: prevent double free or use-after-free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On 11/25/2011 12:56 PM, Kevin Wolf wrote: >> qemu_iovec_destroy does not clear the QEMUIOVector fully, and the data >> > could thus be used after free or freed again. While I do not know any >> > example in the tree, I observed this using virtio-scsi (and SCSI >> > scatter/gather) when canceling DMA requests. >> > >> > Signed-off-by: Paolo Bonzini > This isn't a bug fix for itself, it just makes bugs in other code more > visible, right? It probably makes sense to do this change, but I'm not > sure about doing it for 1.0. It is a fix. NULLing the pointer prevents double-free bugs, and setting niov/nalloc to 0 should prevent use-after-free. Paolo