linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Guenter Roeck <guenter.roeck@ericsson.com>
Subject: [ 39/47] hwmon: (coretemp) fix oops on cpu unplug
Date: Fri, 04 May 2012 13:43:23 -0700	[thread overview]
Message-ID: <20120504204248.224278094@linuxfoundation.org> (raw)
In-Reply-To: <20120504204307.GA13761@kroah.com>

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

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

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

commit b704871124b477807966f06789c2b32f2de58bf7 upstream.

coretemp tries to access core_data array beyond bounds on cpu unplug if
core id of the cpu if more than NUM_REAL_CORES-1.

BUG: unable to handle kernel NULL pointer dereference at 000000000000013c
IP: [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
PGD 673e5a067 PUD 66e9b3067 PMD 0
Oops: 0000 [#1] SMP
CPU 79
Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 ip6_tables xt_state nf_conntrack coretemp crc32c_intel asix tpm_tis pcspkr usbnet iTCO_wdt i2c_i801 microcode mii joydev tpm i2c_core iTCO_vendor_support tpm_bios i7core_edac igb ioatdma edac_core dca megaraid_sas [last unloaded: oprofile]

Pid: 3315, comm: set-cpus Tainted: G        W    3.4.0-rc5+ #2 QCI QSSC-S4R/QSSC-S4R
RIP: 0010:[<ffffffffa00159af>]  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
RSP: 0018:ffff880472fb3d48  EFLAGS: 00010246
RAX: 0000000000000124 RBX: 0000000000000034 RCX: 00000000ffffffff
RDX: 0000000000000000 RSI: 0000000000000046 RDI: 0000000000000246
RBP: ffff880472fb3d88 R08: ffff88077fcd36c0 R09: 0000000000000001
R10: ffffffff8184bc48 R11: 0000000000000000 R12: ffff880273095800
R13: 0000000000000013 R14: ffff8802730a1810 R15: 0000000000000000
FS:  00007f694a20f720(0000) GS:ffff88077fcc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000013c CR3: 000000067209b000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process set-cpus (pid: 3315, threadinfo ffff880472fb2000, task ffff880471fa0000)
Stack:
 ffff880277b4c308 0000000000000003 ffff880472fb3d88 0000000000000005
 0000000000000034 00000000ffffffd1 ffffffff81cadc70 ffff880472fb3e14
 ffff880472fb3dc8 ffffffff8161f48d ffff880471fa0000 0000000000000034
Call Trace:
 [<ffffffff8161f48d>] notifier_call_chain+0x4d/0x70
 [<ffffffff8107f1be>] __raw_notifier_call_chain+0xe/0x10
 [<ffffffff81059d30>] __cpu_notify+0x20/0x40
 [<ffffffff815fa251>] _cpu_down+0x81/0x270
 [<ffffffff815fa477>] cpu_down+0x37/0x50
 [<ffffffff815fd6a3>] store_online+0x63/0xc0
 [<ffffffff813c7078>] dev_attr_store+0x18/0x30
 [<ffffffff811f02cf>] sysfs_write_file+0xef/0x170
 [<ffffffff81180443>] vfs_write+0xb3/0x180
 [<ffffffff8118076a>] sys_write+0x4a/0x90
 [<ffffffff816236a9>] system_call_fastpath+0x16/0x1b
Code: 48 c7 c7 94 60 01 a0 44 0f b7 ac 10 ac 00 00 00 31 c0 e8 41 b7 5f e1 41 83 c5 02 49 63 c5 49 8b 44 c4 10 48 85 c0 74 56 45 31 ff <39> 58 18 75 4e eb 1f 49 63 d7 4c 89 f7 48 89 45 c8 48 6b d2 28
RIP  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
 RSP <ffff880472fb3d48>
CR2: 000000000000013c

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hwmon/coretemp.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -752,6 +752,10 @@ static void __cpuinit put_core_offline(u
 
 	indx = TO_ATTR_NO(cpu);
 
+	/* The core id is too big, just return */
+	if (indx > MAX_CORE_DATA - 1)
+		return;
+
 	if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu)
 		coretemp_remove_core(pdata, &pdev->dev, indx);
 



  parent reply	other threads:[~2012-05-04 20:50 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 20:43 [ 00/47] 3.0.31-stable review Greg KH
2012-05-04 20:42 ` [ 01/47] nfs: Enclose hostname in brackets when needed in nfs_do_root_mount Greg KH
2012-05-04 20:42 ` [ 02/47] NFSv4: Ensure that the LOCK code sets exception->inode Greg KH
2012-05-04 20:42 ` [ 03/47] NFSv4: Ensure that we check lock exclusive/shared type against open modes Greg KH
2012-05-04 20:42 ` [ 04/47] x86, apic: APIC code touches invalid MSR on P5 class machines Greg KH
2012-05-04 20:42 ` [ 05/47] Revert "autofs: work around unhappy compat problem on x86-64" Greg KH
2012-05-04 20:42 ` [ 06/47] xen: correctly check for pending events when restoring irq flags Greg KH
2012-05-04 20:42 ` [ 07/47] xen/smp: Fix crash when booting with ACPI hotplug CPUs Greg KH
2012-05-04 20:42 ` [ 08/47] ASoC: dapm: Ensure power gets managed for line widgets Greg KH
2012-05-04 20:42 ` [ 09/47] dmaengine: at_hdmac: remove clear-on-read in atc_dostart() Greg KH
2012-05-04 20:42 ` [ 10/47] hwmon: fam15h_power: fix bogus values with current BIOSes Greg KH
2012-05-04 20:42 ` [ 11/47] hwmon: (fam15h_power) Fix pci_device_id array Greg KH
2012-05-04 20:42 ` [ 12/47] drm/i915: handle input/output sdvo timings separately in mode_set Greg KH
2012-05-04 20:42 ` [ 13/47] drm/i915: fix integer overflow in i915_gem_execbuffer2() Greg KH
2012-05-04 20:42 ` [ 14/47] drm/i915: fix integer overflow in i915_gem_do_execbuffer() Greg KH
2012-05-04 20:42 ` [ 15/47] nl80211: ensure interface is up in various APIs Greg KH
2012-05-04 20:43 ` [ 16/47] EHCI: fix criterion for resuming the root hub Greg KH
2012-05-04 20:43 ` [ 17/47] brcm80211: smac: resume transmit fifo upon receiving frames Greg KH
2012-05-04 20:43 ` [ 18/47] Fix modpost failures in fedora 17 Greg KH
2012-05-04 20:43 ` [ 19/47] KVM: unmap pages from the iommu when slots are removed Greg KH
2012-05-04 20:43 ` [ 20/47] mmc: unbreak sdhci-esdhc-imx on i.MX25 Greg KH
2012-05-04 20:43 ` [ 21/47] nfsd: fix b0rken error value for setattr on read-only mount Greg KH
2012-05-04 20:43 ` [ 22/47] nfsd: fix error values returned by nfsd4_lockt() when nfsd_open() fails Greg KH
2012-05-04 20:43 ` [ 23/47] [PATCH] Revert "usb: Fix build error due to dma_mask is not at pdev_archdata at ARM" Greg KH
2012-05-07  1:59   ` Ben Hutchings
2012-05-08  0:31     ` Greg KH
2012-05-04 20:43 ` [ 24/47] USB: cdc-wdm: fix race leading leading to memory corruption Greg KH
2012-05-04 20:43 ` [ 25/47] USB: EHCI: fix crash during suspend on ASUS computers Greg KH
2012-05-04 20:43 ` [ 26/47] USB: gadget: storage gadgets send wrong error code for unknown commands Greg KH
2012-05-04 20:43 ` [ 27/47] usb gadget: uvc: uvc_request_data::length field must be signed Greg KH
2012-05-04 20:43 ` [ 28/47] pipes: add a "packetized pipe" mode for writing Greg KH
2012-05-04 20:43 ` [ 29/47] autofs: make the autofsv5 packet file descriptor use a packetized pipe Greg KH
2012-05-04 20:43 ` [ 30/47] ARM: 7403/1: tls: remove covert channel via TPIDRURW Greg KH
2012-05-04 20:43 ` [ 31/47] SCSI: libsas: fix sas_find_bcast_phy() in the presence of vacant phys Greg KH
2012-05-04 20:43 ` [ 32/47] SCSI: libsas: fix false positive device attached conditions Greg KH
2012-05-04 20:43 ` [ 33/47] efi: Add new variable attributes Greg KH
2012-05-04 20:43 ` [ 34/47] efivars: String functions Greg KH
2012-05-04 20:43 ` [ 35/47] efivars: fix warnings when CONFIG_PSTORE=n Greg KH
2012-05-04 20:43 ` [ 36/47] efi: Validate UEFI boot variables Greg KH
2012-05-04 20:43 ` [ 37/47] efivars: Improve variable validation Greg KH
2012-05-04 20:43 ` [ 38/47] hwmon: (coretemp) Increase CPU core limit Greg KH
2012-05-04 20:43 ` Greg KH [this message]
2012-05-04 20:43 ` [ 40/47] libata: skip old error history when counting probe trials Greg KH
2012-05-04 20:43 ` [ 41/47] i2c: pnx: Disable clk in suspend Greg KH
2012-05-04 20:43 ` [ 42/47] ipw2200: Fix race condition in the command completion acknowledge Greg KH
2012-05-04 20:43 ` [ 43/47] mac80211: fix AP mode EAP tx for VLAN stations Greg KH
2012-05-04 20:43 ` [ 44/47] rtlwifi: Fix oops on unload Greg KH
2012-05-04 20:43 ` [ 45/47] wl1251: fix crash on remove due to premature kfree Greg KH
2012-05-04 20:43 ` [ 46/47] wl1251: fix crash on remove due to leftover work item Greg KH
2012-05-04 20:43 ` [ 47/47] sched: Fix nohz load accounting -- again! Greg KH

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=20120504204248.224278094@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=guenter.roeck@ericsson.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).