Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755035Ab2K2XuX (ORCPT ); Thu, 29 Nov 2012 18:50:23 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:37672 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754205Ab2K2XuV (ORCPT ); Thu, 29 Nov 2012 18:50:21 -0500 MIME-Version: 1.0 In-Reply-To: <28227702.6DTxM78Dej@vostro.rjw.lan> References: <1829835.4TBEQGhjkq@vostro.rjw.lan> <28227702.6DTxM78Dej@vostro.rjw.lan> Date: Thu, 29 Nov 2012 16:50:20 -0700 Message-ID: Subject: Re: [PATCH] ACPI / PNP: Do not crash due to stale pointer use during system resume From: Shuah Khan To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , LKML , Linux PM list , Zdenek Kabelac Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2171 Lines: 44 On Thu, Nov 29, 2012 at 4:51 PM, Rafael J. Wysocki wrote: > On Thursday, November 29, 2012 04:25:20 PM Shuah Khan wrote: >> On Thu, Nov 29, 2012 at 4:10 PM, Rafael J. Wysocki wrote: >> > From: Rafael J. Wysocki >> > >> > During resume from system suspend the 'data' field of >> > struct pnp_dev in pnpacpi_set_resources() may be a stale pointer, >> > due to removal of the associated ACPI device node object in the >> > previous suspend-resume cycle. This happens, for example, if a >> > dockable machine is booted in the docking station and then suspended >> > and resumed and suspended again. If that happens, >> > pnpacpi_build_resource_template() called from pnpacpi_set_resources() >> > attempts to use that pointer and crashes. >> > >> > However, pnpacpi_set_resources() actually checks the device's ACPI >> > handle, attempts to find the ACPI device node object attached to it >> > and returns an error code if that fails, so in fact it knows what the >> > correct value of dev->data should be. Use this observation to update >> > dev->data with the correct value if necessary and dump a call trace >> > if that's the case (once). >> > >> > We still need to fix the root cause of this issue, but preventing >> > systems from crashing because of it is an improvement too. >> > >> > Reported-and-tested-by: Zdenek Kabelac >> > References: https://bugzilla.kernel.org/show_bug.cgi?id=51071 >> > Signed-off-by: Rafael J. Wysocki >> >> Any reason why this shouldn't go into stable releases? > > Yes, it can go to -stable. This is just a patch, not a git commit. I can > still add the "stable" tag to it when it goes to git. :-) > Good. This patch applies just fine to 3.0.x, 3.4.x and 3.6.x for what its worth. That's how far I have gotten so far and getting ready to do compile tests on these. -- Shuah -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/