lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060729164115.GA16946@redhat.com>
Date:	Sat, 29 Jul 2006 12:41:15 -0400
From:	Dave Jones <davej@...hat.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: via sata oops on init

On Sat, Jul 29, 2006 at 04:45:28PM +0200, Johannes Weiner wrote:

 >  ..
 > ata_device_add fails, calls ata_host_remove with pointers to unitialized
 > memory.

This should do it.  Jeff?

Fix reference of uninitialised memory in ata_device_add()

Signed-off-by: Dave Jones <davej@...hat.com>

--- linux-2.6/drivers/scsi/libata-core.c~	2006-07-29 12:35:32.000000000 -0400
+++ linux-2.6/drivers/scsi/libata-core.c	2006-07-29 12:39:08.000000000 -0400
@@ -5419,10 +5419,10 @@ int ata_device_add(const struct ata_prob
 		unsigned long xfer_mode_mask;
 
 		ap = ata_host_add(ent, host_set, i);
+		host_set->ports[i] = ap;
 		if (!ap)
 			goto err_out;
 
-		host_set->ports[i] = ap;
 		xfer_mode_mask =(ap->udma_mask << ATA_SHIFT_UDMA) |
 				(ap->mwdma_mask << ATA_SHIFT_MWDMA) |
 				(ap->pio_mask << ATA_SHIFT_PIO);
@@ -5532,6 +5532,8 @@ int ata_device_add(const struct ata_prob
 
 err_out:
 	for (i = 0; i < count; i++) {
+		if (!host_set->ports[i])
+			break;
 		ata_host_remove(host_set->ports[i], 1);
 		scsi_host_put(host_set->ports[i]->host);
 	}

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ