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: <87fubqx4ys.fsf@ashishki-desk.ger.corp.intel.com>
Date:   Wed, 13 Sep 2017 13:34:03 +0300
From:   Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To:     Will Deacon <will.deacon@....com>
Cc:     Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/aux: Only update aux_wakeup in non-overwrite mode

Will Deacon <will.deacon@....com> writes:

> Hi Alexander,
>
> On Wed, Sep 06, 2017 at 07:08:11PM +0300, Alexander Shishkin wrote:
>> Commit d9a50b0256 ("perf/aux: Ensure aux_wakeup represents most recent
>> wakeup index") changed aux wakeup position calculation to rounddown(),
>> which causes a division-by-zero in AUX overwrite mode (aka "snapshot
>> mode").
>> 
>> The zero denominator results from the fact that perf record doesn't set
>> aux_watermark to anything, in which case the kernel will set it to half
>> the AUX buffer size, but only for non-overwrite mode. In the overwrite
>> mode aux_watermark stays zero.
>> 
>> The good news is that, AUX overwrite mode, wakeups don't happen and
>> related bookkeeping is not relevant, so we can simply forego the whole
>> wakeup updates.
>> 
>> Signed-off-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
>> ---
>>  kernel/events/ring_buffer.c | 20 +++++++++++++++-----
>>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> Damn, sorry about that. How did you spot the problem?

A normal perf record with -S should trigger it, I don't remember what
exactly I was doing at that moment. But no worries, we all missed it the
first time around. :)

> Anyway, I think the code is much better with this factored out:
>
> Acked-by: Will Deacon <will.deacon@....com>

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ