All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@suse.de>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	jolsa@redhat.com,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: Re: [PATCH] ACPI / CPPC: Fix per-CPU pointers management
Date: Wed, 14 Dec 2016 03:26:22 +0100	[thread overview]
Message-ID: <11962789.3qxXzldTRG@aspire.rjw.lan> (raw)
In-Reply-To: <296282606.tnoJCKgU2l@aspire.rjw.lan>

On Saturday, December 10, 2016 12:52:28 AM Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Enabling ACPI CPPC on x86 causes a NULL pointer dereference to occur
> (on boot on a "default" KVM setup) in acpi_cppc_processor_exit() due
> to a missing check against NULL in there:
> 
> |BUG: unable to handle kernel NULL pointer dereference at           (null)
> |IP: [<ffffffff812aab6e>] acpi_cppc_processor_exit+0x40/0x60
> |PGD 0 [    0.577616]
> |Oops: 0000 [#1] SMP
> |Modules linked in:
> |CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc6-00146-g17669006adf6 #51
> |task: ffff88003f878000 task.stack: ffffc90000008000
> |RIP: 0010:[<ffffffff812aab6e>]  [<ffffffff812aab6e>] acpi_cppc_processor_exit+0x40/0x60
> |RSP: 0000:ffffc9000000bd48  EFLAGS: 00010296
> |RAX: 00000000000137e0 RBX: 0000000000000000 RCX: 0000000000000001
> |RDX: ffff88003fc00000 RSI: 0000000000000000 RDI: ffff88003fbca130
> |RBP: ffffc9000000bd60 R08: 0000000000000514 R09: 0000000000000000
> |R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000002
> |R13: 0000000000000020 R14: ffffffff8167cb00 R15: 0000000000000000
> |FS:  0000000000000000(0000) GS:ffff88003fcc0000(0000) knlGS:0000000000000000
> |CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> |CR2: 0000000000000000 CR3: 0000000001618000 CR4: 00000000000406e0
> |Stack:
> | ffff88003f939848 ffff88003fbca130 0000000000000001 ffffc9000000bd80
> | ffffffff812a4ccb ffff88003fc0cee8 0000000000000000 ffffc9000000bdb8
> | ffffffff812dc20d ffff88003fc0cee8 ffffffff8167cb00 ffff88003fc0cf48
> |Call Trace:
> | [<ffffffff812a4ccb>] acpi_processor_stop+0xb2/0xc5
> | [<ffffffff812dc20d>] driver_probe_device+0x14d/0x2f0
> | [<ffffffff812dc41e>] __driver_attach+0x6e/0x90
> | [<ffffffff812da234>] bus_for_each_dev+0x54/0x90
> | [<ffffffff812dbbf9>] driver_attach+0x19/0x20
> | [<ffffffff812db6a6>] bus_add_driver+0xe6/0x200
> | [<ffffffff812dcb23>] driver_register+0x83/0xc0
> | [<ffffffff816f050a>] acpi_processor_driver_init+0x20/0x94
> | [<ffffffff81000487>] do_one_initcall+0x97/0x180
> | [<ffffffff816ccf5c>] kernel_init_freeable+0x112/0x1a6
> | [<ffffffff813a0fc9>] kernel_init+0x9/0xf0
> | [<ffffffff813acf35>] ret_from_fork+0x25/0x30
> |Code: 02 00 00 00 48 8b 14 d5 e0 c3 55 81 48 8b 1c 02 4c 8d 6b 20 eb 15 49 8b 7d 00 48 85 ff 74 05 e8 39 8c d9 ff 41 ff c4 49 83 c5 20 <44> 3b 23 72 e6 48 8d bb a0 02 00 00 e8 b1 6f f9 ff 48 89 df e8
> |RIP  [<ffffffff812aab6e>] acpi_cppc_processor_exit+0x40/0x60
> | RSP <ffffc9000000bd48>
> |CR2: 0000000000000000
> 
> Fix that and while at it, fix a possible use-after-free scenario in
> acpi_cppc_processor_probe() that can happen if the function returns
> without cleaning up the per-CPU pointer set by it previously.
> 
> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Original-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> Hi Thomas,
> 
> The crash fixed by this is exposed by the ITMT (asymmetric packing) series
> (which involves using ACPI CPPC on x86), so IMO it would be good to route it
> through tip along with that series.

The problematic commit has gone in already, so I'll route the fix through
the ACPI tree.

Thanks,
Rafael


      parent reply	other threads:[~2016-12-14  2:26 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 20:23 [PATCH v8 0/8] Support Intel Turbo Boost Max Technology 3.0 Tim Chen
2016-11-22 20:23 ` [PATCH v8 1/8] sched: Extend scheduler's asym packing Tim Chen
2016-11-23 13:09   ` Peter Zijlstra
2016-11-23 17:32     ` Tim Chen
2016-11-24 13:25   ` [tip:sched/core] " tip-bot for Tim Chen
2016-11-22 20:23 ` [PATCH v8 2/8] x86/topology: Define x86's arch_update_cpu_topology Tim Chen
2016-11-24 19:52   ` [tip:x86/core] " tip-bot for Tim Chen
2016-11-22 20:23 ` [PATCH v8 3/8] x86: Enable Intel Turbo Boost Max Technology 3.0 Tim Chen
2016-11-24 19:52   ` [tip:x86/core] " tip-bot for Tim Chen
2016-11-25  8:19     ` Ingo Molnar
2016-11-25  8:39       ` Peter Zijlstra
2016-11-25 19:06       ` Thomas Gleixner
2016-11-28  8:51         ` Ingo Molnar
2016-11-28 17:35           ` Tim Chen
2016-11-28 23:22             ` Rafael J. Wysocki
2016-11-29  7:11             ` Ingo Molnar
2016-11-29 18:45               ` Tim Chen
2016-11-22 20:23 ` [PATCH v8 4/8] x86/sysctl: Add sysctl for ITMT scheduling feature Tim Chen
2016-11-24 19:53   ` [tip:x86/core] " tip-bot for Tim Chen
2016-11-28  8:56   ` [PATCH v8 4/8] " Borislav Petkov
2016-11-29 17:30     ` Tim Chen
2016-11-29 17:51       ` Borislav Petkov
2016-11-22 20:23 ` [PATCH v8 5/8] x86/sched: Add SD_ASYM_PACKING flags to x86 ITMT CPU Tim Chen
2016-11-24 19:53   ` [tip:x86/core] " tip-bot for Tim Chen
2016-11-22 20:23 ` [PATCH v8 6/8] acpi: bus: Enable HWP CPPC objects Tim Chen
2016-11-24 19:54   ` [tip:x86/core] acpi/bus: " tip-bot for Srinivas Pandruvada
2016-11-22 20:23 ` [PATCH v8 7/8] acpi: bus: Set _OSC for diverse core support Tim Chen
2016-11-24 19:54   ` [tip:x86/core] acpi/bus: " tip-bot for Srinivas Pandruvada
2016-11-22 20:24 ` [PATCH v8 8/8] cpufreq: intel_pstate: Use CPPC to get max performance Tim Chen
2016-11-24 19:55   ` [tip:x86/core] cpufreq/intel_pstate: " tip-bot for Rafael J. Wysocki
2016-12-07 19:06   ` [PATCH v8 8/8] cpufreq: intel_pstate: " Sebastian Andrzej Siewior
2016-12-07 23:12     ` Tim Chen
2016-12-07 23:29       ` Rafael J. Wysocki
2016-12-09 14:45         ` Sebastian Andrzej Siewior
2016-12-09 15:02           ` Rafael J. Wysocki
2016-12-09 23:52             ` [PATCH] ACPI / CPPC: Fix per-CPU pointers management Rafael J. Wysocki
2016-12-10 18:51               ` Sebastian Andrzej Siewior
2016-12-12  1:00                 ` Rafael J. Wysocki
2016-12-14  2:26               ` Rafael J. Wysocki [this message]

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=11962789.3qxXzldTRG@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=bigeasy@linutronix.de \
    --cc=bp@suse.de \
    --cc=jolsa@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.