linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: "Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"David Müller" <dave.mueller@gmx.ch>,
	jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH] libata: fix out-of-bounds access in pata_oldpiix.c
Date: Fri, 01 Aug 2008 13:35:06 +0900	[thread overview]
Message-ID: <4892927A.1000808@kernel.org> (raw)
In-Reply-To: <200807181615.26272.bzolnier@gmail.com>

Bartlomiej Zolnierkiewicz wrote:
> On Friday 18 July 2008, Alan Cox wrote:
>> On Fri, 18 Jul 2008 09:06:12 +0200
>> David Müller <dave.mueller@gmx.ch> wrote:
>>
>>> 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".
>> This looks wrong adev->dma_mode should never be invalid at this point.
>> Are you not confusing dma_mask and dma_mode. Can you provide the
>> backtraces of the failing case and the actual chip variant you are using ?
>>
>> Either way the fix is not in oldpiix if this is appearing as 0xFF but in
>> the core code so NAK
> 
> ->dma_mode == 0xff means that DMA is unsupported by a given device
> and according to the core code it is a valid ->dma_mode setting.
> 
> This may want to be changed in the future but as the things are right
> now David's patch is correct and fixes a real bug.  Please UNNAK.

Alan, David's patch is correct.  0xff indicates unsupported transfer
mode (mainly because 0x00 is valid PIO mode).  ->set_pio/dmamode won't
see it as libata-core won't call them if unsupported but qc_issue will
see it.  Can you please unnak?

-- 
tejun

  reply	other threads:[~2008-08-01  4:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-08-01 22:29       ` Alan Cox
2008-08-03  5:22         ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4892927A.1000808@kernel.org \
    --to=tj@kernel.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bzolnier@gmail.com \
    --cc=dave.mueller@gmx.ch \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).