lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 Jan 2017 09:38:07 -0500
From:   Prarit Bhargava <prarit@...hat.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org
CC:     stable@...r.kernel.org,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Borislav Petkov <bp@...e.de>, "H. Peter Anvin" <hpa@...or.com>,
        Harish Chegondi <harish.chegondi@...el.com>,
        Jiri Olsa <jolsa@...hat.com>, Kan Liang <kan.liang@...el.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Stephane Eranian <eranian@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Vince Weaver <vincent.weaver@...ne.edu>,
        Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 4.9 033/120] perf/x86/intel/uncore: Fix hardcoded socket
 0 assumption in the Haswell init code



On 01/18/2017 05:45 AM, Greg Kroah-Hartman wrote:
> 4.9-stable review patch.  If anyone has any objections, please let me know.
> 

Nack.

The value of boot_cpu_data.logical_proc_id may be uninitialized and set to
default -1 on systems that pick a random core as boot cpu.  This was
inadvertently fixed by 9d85eb9119f4 ("x86/smpboot: Make logical package
management more robust") which is in 4.10-rc1.

Before 9d85eb9119f4:

[    3.971539] hswep_uncore_cpu_init: cpu 5 pkg 0 boot_cpu_data.logical_proc_id
65535
[    3.976504] hswep_uncore_cpu_init: cpu 5 pkg 0 cpu_data(0).logical_proc_id 0

After 9d85eb9119f4:

[    3.919112] hswep_uncore_cpu_init: cpu 5 pkg 0 boot_cpu_data.logical_proc_id 0
[    3.923391] hswep_uncore_cpu_init: cpu 5 pkg 0 cpu_data(0).logical_proc_id 0

This patch should not be applied to any stable branch.

P.


> ------------------
> 
> From: Prarit Bhargava <prarit@...hat.com>
> 
> commit 6d6daa20945f3f598e56e18d1f926c08754f5801 upstream.
> 
> hswep_uncore_cpu_init() uses a hardcoded physical package id 0 for the boot
> cpu. This works as long as the boot CPU is actually on the physical package
> 0, which is normaly the case after power on / reboot.
> 
> But it fails with a NULL pointer dereference when a kdump kernel is started
> on a secondary socket which has a different physical package id because the
> locigal package translation for physical package 0 does not exist.
> 
> Use the logical package id of the boot cpu instead of hard coded 0.
> 
> [ tglx: Rewrote changelog once more ]
> 
> Fixes: cf6d445f6897 ("perf/x86/uncore: Track packages, not per CPU data")
> Signed-off-by: Prarit Bhargava <prarit@...hat.com>
> Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Borislav Petkov <bp@...e.de>
> Cc: H. Peter Anvin <hpa@...or.com>
> Cc: Harish Chegondi <harish.chegondi@...el.com>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Kan Liang <kan.liang@...el.com>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Stephane Eranian <eranian@...gle.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Vince Weaver <vincent.weaver@...ne.edu>
> Link: http://lkml.kernel.org/r/1483628965-2890-1-git-send-email-prarit@redhat.com
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> 
> ---
>  arch/x86/events/intel/uncore_snbep.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/arch/x86/events/intel/uncore_snbep.c
> +++ b/arch/x86/events/intel/uncore_snbep.c
> @@ -2686,7 +2686,7 @@ static struct intel_uncore_type *hswep_m
>  
>  void hswep_uncore_cpu_init(void)
>  {
> -	int pkg = topology_phys_to_logical_pkg(0);
> +	int pkg = boot_cpu_data.logical_proc_id;
>  
>  	if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
>  		hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ