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:   Thu, 17 May 2018 15:09:36 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Dave Hansen <dave.hansen@...ux.intel.com>
Cc:     Adrian Hunter <adrian.hunter@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andy Lutomirski <luto@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>, Andi Kleen <ak@...ux.intel.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Joerg Roedel <joro@...tes.org>, Jiri Olsa <jolsa@...hat.com>,
        linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH V2 03/20] x86: Add entry trampolines to kcore

Em Thu, May 17, 2018 at 10:52:30AM -0700, Dave Hansen escreveu:
> On 05/17/2018 02:21 AM, Adrian Hunter wrote:
> > From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> > 
> > Signed-off-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> 
> For the benefit of the poor souls looking at this code in the decades to
> come, could you please take a few minutes to write a couple of sentences
> about why this is being done?

Hey, for the poor souls reading in _this_ decade as well! ;-)

- Arnaldo
 
> > diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c
> > index d1da5cf4b2de..fb1fbc8538fa 100644
> > --- a/arch/x86/mm/cpu_entry_area.c
> > +++ b/arch/x86/mm/cpu_entry_area.c
> > @@ -3,6 +3,7 @@
> >  #include <linux/spinlock.h>
> >  #include <linux/percpu.h>
> >  #include <linux/kallsyms.h>
> > +#include <linux/kcore.h>
> >  
> >  #include <asm/cpu_entry_area.h>
> >  #include <asm/pgtable.h>
> > @@ -14,6 +15,7 @@
> >  #ifdef CONFIG_X86_64
> >  static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks
> >  	[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ]);
> > +static DEFINE_PER_CPU(struct kcore_list, kcore_entry_trampoline);
> >  #endif
> >  
> >  struct cpu_entry_area *get_cpu_entry_area(int cpu)
> > @@ -147,6 +149,9 @@ static void __init setup_cpu_entry_area(int cpu)
> >  
> >  	cea_set_pte(&get_cpu_entry_area(cpu)->entry_trampoline,
> >  		     __pa_symbol(_entry_trampoline), PAGE_KERNEL_RX);
> > +	kclist_add(&per_cpu(kcore_entry_trampoline, cpu),
> > +		   &get_cpu_entry_area(cpu)->entry_trampoline, PAGE_SIZE,
> > +		   KCORE_TEXT);
> >  #endif
> 
> Any reason not to add a comment like:
> 
> /*
>  * The cpu_entry_area alias addresses are not in the kernel binary
>  * so they do not show up in /proc/kcore normally.  This adds entries
>  * for them manually.
>  */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ