From patchwork Tue Oct 23 10:17:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 193418 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D2A152C0100 for ; Tue, 23 Oct 2012 21:18:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752375Ab2JWKRz (ORCPT ); Tue, 23 Oct 2012 06:17:55 -0400 Received: from mail.skyhub.de ([78.46.96.112]:41878 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752825Ab2JWKRy (ORCPT ); Tue, 23 Oct 2012 06:17:54 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1350987472; bh=uOMVHHLnQgX57I4no2A5NN5olVzSzMtLUV2WaSsU9TE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=aOA0NKzJ6jrHfIX2oXJ7kV7IkINY2P9ZsI5oTu L7X2hrCHwfTZF3qgLyZCMcAo5/ej5yQeNTFjIgjEGLMIrxfY/ljbEh/pk4uWNEdhBZb 3lv/dWKNLTFuFP+gy6YwvSP85fJKh01w3VoGlf33pXh7je0DxFqZhyhowcf4IUGFLo= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vfrruh8Yd9X5; Tue, 23 Oct 2012 12:17:52 +0200 (CEST) Received: from liondog.tnic (p54B7FEF0.dip.t-dialin.net [84.183.254.240]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D6CB41D95F8; Tue, 23 Oct 2012 12:17:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1350987472; bh=uOMVHHLnQgX57I4no2A5NN5olVzSzMtLUV2WaSsU9TE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=aOA0NKzJ6jrHfIX2oXJ7kV7IkINY2P9ZsI5oTu L7X2hrCHwfTZF3qgLyZCMcAo5/ej5yQeNTFjIgjEGLMIrxfY/ljbEh/pk4uWNEdhBZb 3lv/dWKNLTFuFP+gy6YwvSP85fJKh01w3VoGlf33pXh7je0DxFqZhyhowcf4IUGFLo= Received: by liondog.tnic (Postfix, from userid 1000) id 494AC4B8ED9; Tue, 23 Oct 2012 12:17:51 +0200 (CEST) Date: Tue, 23 Oct 2012 12:17:51 +0200 From: Borislav Petkov To: Alan Cox Cc: phillip.wood@dunelm.org.uk, "Anton V. Boyarshinov" , bugzilla-daemon@bugzilla.kernel.org, linux-ide@vger.kernel.org, Jeff Garzik Subject: Re: [Bug 49151] New: NULL pointer dereference in pata_acpi Message-ID: <20121023101751.GA24656@liondog.tnic> References: <20121020120047.GC17563@liondog.tnic> <50841CFC.2030802@talktalk.net> <20121021165756.GA20642@liondog.tnic> <50856AA8.1000607@talktalk.net> <20121022202734.GA16169@liondog.tnic> <20121023110549.06f9c2e8@pyramind.ukuu.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121023110549.06f9c2e8@pyramind.ukuu.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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: --- -- Thanks. 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));