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]
Message-ID: <d96f847f-e7b7-f586-27f8-cec4a50cdc0c@ursulin.net>
Date:   Tue, 3 Jul 2018 11:28:09 +0100
From:   Tvrtko Ursulin <tursulin@...ulin.net>
To:     Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Cc:     linux-kernel@...r.kernel.org,
        Tvrtko Ursulin <tvrtko.ursulin@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>,
        x86@...nel.org
Subject: Re: [RFC 2/4] perf: Pass pmu pointer to perf_paranoid_* helpers


Hi Ravi,

On 03/07/18 11:24, Ravi Bangoria wrote:
> Hi Tvrtko,
> 
>> @@ -199,7 +199,7 @@ static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp)
>>   	if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid)
>>   		*addrp = mfspr(SPRN_SDAR);
>>   
>> -	if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) &&
>> +	if (perf_paranoid_kernel(ppmu) && !capable(CAP_SYS_ADMIN) &&
>>   		is_kernel_addr(mfspr(SPRN_SDAR)))
>>   		*addrp = 0;
>>   }
> 
> This patch fails for me on powerpc:
> 
> arch/powerpc/perf/core-book3s.c: In function ‘perf_get_data_addr’:
> arch/powerpc/perf/core-book3s.c:202:27: error: passing argument 1 of ‘perf_paranoid_kernel’ from incompatible pointer type [-Werror=incompatible-pointer-types]
>    if (perf_paranoid_kernel(ppmu) && !capable(CAP_SYS_ADMIN) &&
>                             ^~~~
> In file included from arch/powerpc/perf/core-book3s.c:13:0:
> ./include/linux/perf_event.h:1191:20: note: expected ‘const struct pmu *’ but argument is of type ‘struct power_pmu *’
>   static inline bool perf_paranoid_kernel(const struct pmu *pmu)
>                      ^~~~~~~~~~~~~~~~~~~~
> arch/powerpc/perf/core-book3s.c: In function ‘power_pmu_bhrb_read’:
> arch/powerpc/perf/core-book3s.c:470:8: error: too few arguments to function ‘perf_paranoid_kernel’
>      if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) &&
>          ^~~~~~~~~~~~~~~~~~~~
> In file included from arch/powerpc/perf/core-book3s.c:13:0:
> ./include/linux/perf_event.h:1191:20: note: declared here
>   static inline bool perf_paranoid_kernel(const struct pmu *pmu)
>                      ^~~~~~~~~~~~~~~~~~~~
>    CC      net/ipv6/route.o

Yep, kbuild reported this as well. I will need to re-arrange the code a 
bit to a) pass the correct pointer in, and b) I missed one call-site as 
well.

I was holding of doing that until some more general feedback arrives.

Regards,

Tvrtko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ