From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ide@vger.kernel.org
Subject: [Bug 49151] NULL pointer dereference in pata_acpi
Date: Tue, 23 Oct 2012 16:12:19 +0000 (UTC) [thread overview]
Message-ID: <20121023161219.6FC5711FB3D@bugzilla.kernel.org> (raw)
In-Reply-To: <bug-49151-11633@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=49151
--- Comment #17 from Borislav Petkov <bp@alien8.de> 2012-10-23 16:12:18 ---
On Tue, Oct 23, 2012 at 12:17:51PM +0200, Borislav Petkov wrote:
> On Tue, Oct 23, 2012 at 11:05:49AM +0100, Alan Cox wrote:
> > > So yes, blacklisting it and verifying that your system still operates
> > > normally would be something to do. If it does, you could also build a
> > > kernel with pata_acpi disabled (that is, provided you build your own
> > > kernels).
> >
> > The crash is still a bug. It needs chasing down.
>
> Yes, ata_timing_find_mode gives NULL, we found that out.
>
> Anton, Phillip, anyone willing to run this hunk below and get us the
> output:
>
> ---
> diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
> index 09723b76beac..80d594d6e7c8 100644
> --- a/drivers/ata/pata_acpi.c
> +++ b/drivers/ata/pata_acpi.c
> @@ -144,6 +144,13 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
>
> /* Now stuff the nS values into the structure */
> t = ata_timing_find_mode(adev->dma_mode);
> + if (!t) {
> + pr_err("%s: ata_timing_find_mode gives NULL; adev->dma_mode: 0x%x\n",
> + __func__, adev->dma_mode);
> +
> + return;
> + }
> +
> if (adev->dma_mode >= XFER_UDMA_0) {
> acpi->gtm.drive[unit].dma = t->udma;
> acpi->gtm.flags |= (1 << (2 * unit));
> --
Ok, here's the output from Anton's box
(https://bugzilla.kernel.org/show_bug.cgi?id=49151#c16):
pacpi_set_dmamode: ata_timing_find_mode gives NULL; adev->dma_mode: 0x0
And in that case we should've matched XFER_PIO_SLOW but it is commented
out for some reason.
Judging by 70cd071e4ecc06c985189665af75c108601fd5a3, I think we should
involve Tejun into this.
@Tejun: so basically there are two people with oopses when using
pata_acpi because pacpi_set_dmamode queries xfer mode with
adev->dma_mode = 0x0 and ata_timing_find_mode returns NULL (presumably a
BIOS bug, I'd say).
More details if you follow the thread here:
http://marc.info/?l=linux-ide&m=135073445731432
I don't know how to fix this since if BIOS gives xfer_mode 0, how can
each pata controller find its max mode? Sure, we can always fall back to
0x0 but that is the slowest and not necessarily optimal.
One other possibility could be to load chipset-specific drivers first
and pata_acpi only as a last resort but I don't know whether this is
doable at all.
Thanks.
--
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
next prev parent reply other threads:[~2012-10-23 16:12 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-20 10:19 [Bug 49151] New: NULL pointer dereference in pata_acpi bugzilla-daemon
2012-10-20 10:31 ` [Bug 49151] " bugzilla-daemon
2012-10-20 10:33 ` bugzilla-daemon
2012-10-20 12:00 ` [Bug 49151] New: " Borislav Petkov
2012-10-21 16:04 ` Phillip Wood
2012-10-21 16:57 ` Borislav Petkov
2012-10-22 15:47 ` Phillip Wood
2012-10-22 20:27 ` Borislav Petkov
2012-10-23 10:05 ` Alan Cox
2012-10-23 10:17 ` Borislav Petkov
2012-10-23 16:12 ` Borislav Petkov
2012-10-24 6:43 ` Anton V. Boyarshinov
2012-10-24 9:28 ` Phillip Wood
2012-10-24 10:57 ` Alan Cox
2012-11-03 4:26 ` Borislav Petkov
2012-11-03 16:30 ` Alan Cox
2012-11-03 16:48 ` Alan Cox
2012-11-16 4:50 ` Jeff Garzik
2012-10-20 12:00 ` [Bug 49151] " bugzilla-daemon
2012-10-21 16:04 ` bugzilla-daemon
2012-10-21 16:58 ` bugzilla-daemon
2012-10-22 12:15 ` bugzilla-daemon
2012-10-22 12:21 ` bugzilla-daemon
2012-10-22 12:42 ` bugzilla-daemon
2012-10-22 15:48 ` bugzilla-daemon
2012-10-22 20:27 ` bugzilla-daemon
2012-10-22 20:40 ` bugzilla-daemon
2012-10-22 21:06 ` bugzilla-daemon
2012-10-23 10:01 ` bugzilla-daemon
2012-10-23 10:17 ` bugzilla-daemon
2012-10-23 11:02 ` bugzilla-daemon
2012-10-23 12:54 ` bugzilla-daemon
2012-10-23 16:12 ` bugzilla-daemon [this message]
2012-10-23 16:39 ` bugzilla-daemon
2012-10-23 20:11 ` bugzilla-daemon
2012-10-23 20:41 ` bugzilla-daemon
2012-10-23 20:52 ` bugzilla-daemon
2012-10-23 21:10 ` bugzilla-daemon
2012-10-24 6:43 ` bugzilla-daemon
2012-10-24 9:28 ` bugzilla-daemon
2012-10-24 10:52 ` bugzilla-daemon
2012-10-24 15:25 ` bugzilla-daemon
2012-10-25 14:31 ` bugzilla-daemon
2012-10-29 13:15 ` bugzilla-daemon
2012-10-29 13:36 ` bugzilla-daemon
2012-11-01 15:18 ` bugzilla-daemon
2012-11-02 12:07 ` bugzilla-daemon
2012-11-03 4:23 ` bugzilla-daemon
2012-11-03 4:26 ` bugzilla-daemon
2012-11-03 7:37 ` bugzilla-daemon
2012-11-03 16:25 ` bugzilla-daemon
2012-11-03 16:43 ` bugzilla-daemon
2012-11-15 18:05 ` bugzilla-daemon
2012-11-15 18:07 ` bugzilla-daemon
2012-11-16 4:50 ` bugzilla-daemon
2012-11-16 4:59 ` bugzilla-daemon
2012-11-16 8:39 ` bugzilla-daemon
2012-11-17 16:29 ` bugzilla-daemon
2012-11-17 17:22 ` bugzilla-daemon
2012-11-25 12:55 ` bugzilla-daemon
2012-11-29 2:22 ` bugzilla-daemon
2012-11-29 11:21 ` bugzilla-daemon
2012-11-30 17:10 ` bugzilla-daemon
2012-12-02 17:46 ` bugzilla-daemon
2012-12-03 0:51 ` bugzilla-daemon
2012-12-03 3:39 ` bugzilla-daemon
2012-12-07 7:00 ` bugzilla-daemon
2012-12-18 7:13 ` bugzilla-daemon
2012-12-18 7:26 ` bugzilla-daemon
2012-12-18 12:48 ` bugzilla-daemon
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=20121023161219.6FC5711FB3D@bugzilla.kernel.org \
--to=bugzilla-daemon@bugzilla.kernel.org \
--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).