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, 27 Nov 2017 18:34:17 +0100
From:   Peter Zijlstra <>
To:     Jiri Olsa <>
Cc:     Jiri Olsa <>, Ingo Molnar <>,
        Arnaldo Carvalho de Melo <>,
        lkml <>,
        Namhyung Kim <>,
        David Ahern <>,
        Andi Kleen <>,
        Milind Chabbi <>,
        Alexander Shishkin <>,
        Michael Ellerman <>,
        Hari Bathini <>,
        Jin Yao <>,
        Kan Liang <>,
        Sukadev Bhattiprolu <>,
        Oleg Nesterov <>,
        Will Deacon <>
Subject: Re: [PATCH 4/6] hw_breakpoint: Factor out
 __modify_user_hw_breakpoint function

On Mon, Nov 27, 2017 at 06:25:32PM +0100, Jiri Olsa wrote:
> On Mon, Nov 27, 2017 at 06:12:03PM +0100, Peter Zijlstra wrote:
> > But what validates the input attr is the same as the event attr, aside
> > from those fields?
> we don't.. the attr serves as a holder to carry those fields
> into the function

Then that's a straight up bug.

> the current kernel interface does not check anything else

Not enough, if the new attr would fail perf_event_open() it should also
fail this modify thing.

> there's one more check in the ioctl path, we check the
> type in perf_event_modify_attr:
>         if (event->attr.type != attr->type)
>                 return -EINVAL;

Note how hw_breakpoint_event_init() tests has_branch_stack() and fails
on it.

Ideally we should check a whole lot more and fail, but alas..

Powered by blists - more mailing lists