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: <CAMmz+Yk1EMojbyjEsS9rKEo+kN0YvjO3QHfZ_ih34o2NjT0uYA@mail.gmail.com>
Date:   Tue, 7 Nov 2017 09:42:25 -0800
From:   Milind Chabbi <chabbi.milind@...il.com>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     Milind Chabbi <chabbi.milind@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Jiri Olsa <jolsa@...hat.com>, Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Hari Bathini <hbathini@...ux.vnet.ibm.com>,
        Jin Yao <yao.jin@...ux.intel.com>,
        Kan Liang <kan.liang@...el.com>,
        Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/core: fast breakpoint modification via _IOC_MODIFY_BREAKPOINT.

I am fine with Andi's suggestion. In summary,

1. I will introduce an ioctl flag  _IOC_MODIFY_ATTRIBUTES.
 (Yes, plural ATTRIBUTES not ATTRIBUTE)
2. Currently, implement only updates to breakpoints and all others
will fail with -EOPNOTSUPP.
3. The implementation of breakpoint update shall check the following
before modifying:
     (event->attr.type == PERF_TYPE_BREAKPOINT) && (new_attr.type ==
PERF_TYPE_BREAKPOINT)
     This ensures that both the passed in fd's event and the new_attr
are PERF_TYPE_BREAKPOINT.

Can we have a consensus on this?

Now the question is what other attribute values to check in
the implementation of the breakpoint update.

Do you expect all fields other than the ones that we allow modification remain
unchanged from the original creation time? and if anything changes
should we fail with -EOPNOTSUPP? I think that is too strict.
Expecting them to be zeros can be seen as a change from the original
values, hence zero is not the right expectation.
I am open to suggestions here and your help in listing a few attribute
fields that need
validation will be valuable.

-Milind








On Tue, Nov 7, 2017 at 9:24 AM, Andi Kleen <ak@...ux.intel.com> wrote:
> On Tue, Nov 07, 2017 at 07:43:35AM -0800, Milind Chabbi wrote:
>> Peter,
>>
>> Generic update perf_event_attr interface is noble but impractical.
>> It will cause a validation nightmare.
>> Many of the behaviors or choices will become hard to reason.
>
> I don't think you would necessarily need to support modifying
> all of this. Just define a general interface that could be used
> to modify these things, but right now it would be only
> implemented for the special case of breakpoints.
>
> Your ioctl is very near it anyways, just need to change
> the name and do more sanity checking on the input values.
>
> -Andi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ