linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: fix out-of-bounds access in pata_oldpiix.c
@ 2008-07-18  7:06 David Müller
  2008-07-18  8:55 ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: David Müller @ 2008-07-18  7:06 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-ide

The "pata_oldpiix" driver in linux-2.6.26 is calling its "set_dmamode" 
routine also locally, but under different preconditions as the 
corresponding call in libata-core.c. This may cause an "out-of-array 
bounds" access in "oldpiix_set_dmamode".


Signed-off-by: Dave Mueller <dave.mueller@gmx.ch>

diff -dpurN a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
--- a/drivers/ata/pata_oldpiix.c   2008-07-18 08:13:38.000000000 +0200
+++ b/drivers/ata/pata_oldpiix.c   2008-07-18 08:18:45.000000000 +0200
@@ -198,7 +198,7 @@ static unsigned int oldpiix_qc_issue(str

         if (adev != ap->private_data) {
                 oldpiix_set_piomode(ap, adev);
-               if (adev->dma_mode)
+               if (adev->dma_mode != 0xff)
                         oldpiix_set_dmamode(ap, adev);
         }
         return ata_sff_qc_issue(qc);


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-03  5:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18  7:06 [PATCH] libata: fix out-of-bounds access in pata_oldpiix.c David Müller
2008-07-18  8:55 ` Alan Cox
2008-07-18 14:15   ` Bartlomiej Zolnierkiewicz
2008-08-01  4:35     ` Tejun Heo
2008-08-01 22:29       ` Alan Cox
2008-08-03  5:22         ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).