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: <20071013224452.71d6f61f@the-village.bc.nu>
Date:	Sat, 13 Oct 2007 22:44:52 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [git patches] IDE updates (part 2)

> Comment in pmac_ide_init_hwif_ports() is highly misleading as this function
> returns early only for "normal" IDE PCI devices (pmac_ide_init_hwif_ports()
> can be called outside ide-pmac driver through ppc_ide_md).

Follow the code you pasted

> 	pmif->regbase = (unsigned long) base + 0x2000;
> ...
> 	rc = pmac_ide_setup_device(pmif, hwif);

Ok so regbase is set

> ...
> }
> 
> static int
> pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
> {
> ...
> 	pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq);

Now we pass a honking great zero for the ctrl_port
> ...
> }
> 
> void
> pmac_ide_init_hwif_ports(hw_regs_t *hw,
> 			      unsigned long data_port, unsigned long ctrl_port,
> 			      int *irq)
> {
> ...
> 	for (ix = 0; ix < MAX_HWIFS; ++ix)
> 		if (data_port == pmac_ide[ix].regbase)
> 			break;
> ---> since pmif->regbase was set earlier ix will be < MAX_HWIFS

> 	if (ix >= MAX_HWIFS) {
> 		/* Probably a PCI interface... */
> 		for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i)
> 			hw->io_ports[i] = data_port + i - IDE_DATA_OFFSET;
> 		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;

Which is zero..


See the problem ?

Alan
-
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