stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Toshi Kani <toshi.kani@hp.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: [ 14/23] ACPI / memhotplug: Fix a stale pointer in error path
Date: Fri,  2 Aug 2013 18:23:27 +0800	[thread overview]
Message-ID: <20130802102038.202630483@linuxfoundation.org> (raw)
In-Reply-To: <20130802102036.180660415@linuxfoundation.org>

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Toshi Kani <toshi.kani@hp.com>

commit d19f503e22316a84c39bc19445e0e4fdd49b3532 upstream.

device->driver_data needs to be cleared when releasing its data,
mem_device, in an error path of acpi_memory_device_add().

The function evaluates the _CRS of memory device objects, and fails
when it gets an unexpected resource or cannot allocate memory.  A
kernel crash or data corruption may occur when the kernel accesses
the stale pointer.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/acpi_memhotplug.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -421,6 +421,7 @@ static int acpi_memory_device_add(struct
 	/* Get the range from the _CRS */
 	result = acpi_memory_get_device_resources(mem_device);
 	if (result) {
+		device->driver_data = NULL;
 		kfree(mem_device);
 		return result;
 	}



  parent reply	other threads:[~2013-08-02 10:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 10:23 [ 00/23] 3.0.89-stable review Greg Kroah-Hartman
2013-08-02 10:23 ` [ 01/23] USB: storage: Add MicroVault Flash Drive to unusual_devs Greg Kroah-Hartman
2013-08-02 10:23 ` [ 02/23] ASoC: max98088 - fix element type of the register cache Greg Kroah-Hartman
2013-08-02 10:23 ` [ 03/23] SCSI: sd: fix crash when UA received on DIF enabled device Greg Kroah-Hartman
2013-08-02 10:23 ` [ 04/23] SCSI: qla2xxx: Properly set the tagging for commands Greg Kroah-Hartman
2013-08-14 16:40   ` Jack Hill
2013-08-14 17:04     ` Greg Kroah-Hartman
2013-08-14 17:31       ` Jack Hill
2013-08-02 10:23 ` [ 05/23] tracing: Fix irqs-off tag display in syscall tracing Greg Kroah-Hartman
2013-08-02 10:23 ` [ 06/23] xhci: fix null pointer dereference on ring_doorbell_for_active_rings Greg Kroah-Hartman
2013-08-02 10:23 ` [ 07/23] xhci: Avoid NULL pointer deref when host dies Greg Kroah-Hartman
2013-08-02 10:23 ` [ 08/23] USB: ti_usb_3410_5052: fix dynamic-id matching Greg Kroah-Hartman
2013-08-02 10:23 ` [ 09/23] USB: misc: Add Manhattan Hi-Speed USB DVI Converter to sisusbvga Greg Kroah-Hartman
2013-08-02 10:23 ` [ 10/23] usb: Clear both buffers when clearing a control transfer TT buffer Greg Kroah-Hartman
2013-08-02 10:23 ` [ 11/23] staging: comedi: COMEDI_CANCEL ioctl should wake up read/write Greg Kroah-Hartman
2013-08-02 10:23 ` [ 12/23] libata: make it clear that sata_inic162x is experimental Greg Kroah-Hartman
2013-08-02 10:23 ` [ 13/23] powerpc/modules: Module CRC relocation fix causes perf issues Greg Kroah-Hartman
2013-08-02 10:23 ` Greg Kroah-Hartman [this message]
2013-08-02 10:23 ` [ 15/23] drm/radeon: fix combios tables on older cards Greg Kroah-Hartman
2013-08-02 10:23 ` [ 16/23] drm/radeon: improve dac adjust heuristics for legacy pdac Greg Kroah-Hartman
2013-08-02 10:23 ` [ 17/23] drm/radeon/atom: initialize more atom interpretor elements to 0 Greg Kroah-Hartman
2013-08-02 10:23 ` [ 18/23] USB: serial: ftdi_sio: add more RT Systems ftdi devices Greg Kroah-Hartman
2013-08-02 10:23 ` [ 19/23] livelock avoidance in sget() Greg Kroah-Hartman
2013-08-02 10:23 ` [ 20/23] xen/evtchn: avoid a deadlock when unbinding an event channel Greg Kroah-Hartman
2013-08-02 10:23 ` [ 21/23] virtio: support unlocked queue poll Greg Kroah-Hartman
2013-08-02 10:23 ` [ 22/23] virtio_net: fix race in RX VQ processing Greg Kroah-Hartman
2013-08-02 10:23 ` [ 23/23] mm/memory-hotplug: fix lowmem count overflow when offline pages Greg Kroah-Hartman
2013-08-02 19:59 ` [ 00/23] 3.0.89-stable review Shuah Khan
2013-08-02 21:28 ` Guenter Roeck
2013-08-02 22:36   ` Greg Kroah-Hartman

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=20130802102038.202630483@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=toshi.kani@hp.com \
    /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).