Received: from eggs.gnu.org ([208.118.235.92]:49540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1NiD-0001dY-Sp for qemu-devel@nongnu.org; Tue, 14 Aug 2012 16:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1NiD-0000BW-2b for qemu-devel@nongnu.org; Tue, 14 Aug 2012 16:27:37 -0400 Received: from mail.profihost.ag ([85.158.179.208]:47356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1NiC-0000BS-NX for qemu-devel@nongnu.org; Tue, 14 Aug 2012 16:27:36 -0400 From: Stefan Priebe Date: Tue, 14 Aug 2012 22:27:31 +0200 Message-Id: <1344976052-28499-1-git-send-email-s.priebe@profihost.ag> Subject: [Qemu-devel] PATCH V2: fix NULL dereferences / races between task completition and abort List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This patch fixes a race and some segfaults which i discovered while testing scsi-generic and unmapping with libiscsi. The first problem is that in iscsi_aio_cancel iscsi_scsi_task_cancel and iscsi_task_mgmt_abort_task_async got called but iscsi_task_mgmt_abort_task_async already calls iscsi_scsi_task_cancel. The second problem is that scsi_free_scsi_task(acb->task) and acb->task = NULL must be done when io is complete or the whole task cancelation has finished. Right now it is done in between. Sorry no native speaker i hope i was able to explain what the problem is. Otherwise Ronnie is informed and perhaps explain the problem too.