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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170522084529.GC1478@leverpostej>
Date:   Mon, 22 May 2017 09:45:30 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     "Jin, Yao" <yao.jin@...ux.intel.com>
Cc:     Peter Zijlstra <peterz@...radead.org>, acme@...nel.org,
        jolsa@...nel.org, mingo@...hat.com,
        alexander.shishkin@...ux.intel.com, Linux-kernel@...r.kernel.org,
        ak@...ux.intel.com, kan.liang@...el.com, yao.jin@...el.com,
        Will Deacon <will.deacon@....com>
Subject: Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is
 specified

On Mon, May 22, 2017 at 10:12:22AM +0800, Jin, Yao wrote:
> Hi Peter,
> 
> Maybe it's not very easy to move the skid checking to generic code
> because we don't have a common kernel_ip() available to determine if
> ip is a kernel address.
> 
> I was trying to move kernel_ip() from arch/x86/events/perf_event.h
> to generic code, but some difficulties I have:
> 
> For example, in new kernel_ip(), we may use many
> conditional-compilation for all arch, for example:
> 
> #ifdef CONFIG_X86_32
>     return ip > PAGE_OFFSET;
> #endif
> 
> #ifdef CONFIG_X86_64
>     return (long)ip < 0;
> #endif
> 
> #ifdef CONFIG_ARM....
> ......
> #ifdef CONFIG_MIPS....
> ......
> 
> But the code is being ugly and hard to maintain. And frankly I don't
> know kernel address space for all arch.
> 
> Any idea? Could we just do at x86 side this time?

Can we not check user_mode(regs) for all architectures?

!user_mode(regs) implies a kernel sample.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ