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:   Mon, 6 Aug 2018 15:07:31 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Jiri Olsa <jolsa@...nel.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Milind Chabbi <chabbi.milind@...il.com>,
        lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        David Ahern <dsahern@...il.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Frederic Weisbecker <frederic@...nel.org>
Subject: Re: [PATCH 2/2] perf/hw_breakpoint: Modify breakpoint even if the
 new attr has disabled set

On 08/06, Oleg Nesterov wrote:
>
> But, with or without this fix, shouldn't we set .disabled = 1 if modify_() fails?
> IIUC this doesn't matter, bp->attr.disabled is not really used anyway, but looks a
> bit confusing.

I am looking at another caller perf_event_modify_breakpoint(). It too doesn't set
attr.disabled = 1 on failure, it does _perf_event_enable() instead so attr.disabled
should be correct.

But this looks wrong. If modify_user_hw_breakpoint_check() paths fails after
arch_validate_hwbkpt_settings() was called, then we can not simply restore
bp_addr/bp_type/bp_len and do _perf_event_enable(). We need another
modify_user_hw_breakpoint_check() or validate_hw_breakpoint().

Note that arch_validate_hwbkpt_settings() updates arch_hw_breakpoint according
to bp.attr, the restored bp->attr.bp_addr/bp_typebp_len have no effect if we
call _perf_event_enable() after the failure.

Or I am totally confused?

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ