linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <ak@linux.intel.com>
Cc: Milind Chabbi <chabbi.milind@gmail.com>,
	jolsa@redhat.com, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Hari Bathini <hbathini@linux.vnet.ibm.com>,
	Jin Yao <yao.jin@linux.intel.com>,
	Kan Liang <kan.liang@intel.com>,
	Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf/core: fast breakpoint modification via _IOC_MODIFY_BREAKPOINT.
Date: Tue, 7 Nov 2017 09:15:41 +0100	[thread overview]
Message-ID: <20171107081541.GF3326@worktop> (raw)
In-Reply-To: <20171106231658.GE5320@tassilo.jf.intel.com>

On Mon, Nov 06, 2017 at 03:16:58PM -0800, Andi Kleen wrote:
> > +static int _perf_event_modify_breakpoint(struct perf_event *bp,
> > +					 struct perf_event_attr *attr)
> > +{
> > +	u64 old_addr = bp->attr.bp_addr;
> > +	u64 old_len = bp->attr.bp_len;
> > +	int old_type = bp->attr.bp_type;
> > +	int err = 0;
> > +
> > +	_perf_event_disable(bp);
> > +
> > +	bp->attr.bp_addr = attr->bp_addr;
> > +	bp->attr.bp_type = attr->bp_type;
> > +	bp->attr.bp_len = attr->bp_len;
> 
> You don't check any of the other fields, so user space is free
> to fill in junk. That means they can never be used for anything.
> It would be better to check at least some of them for being
> zero, and also that the type matches the break point.

Yes, the values should at the very least get the exact same validation
they would get on creating an event with those values.

  reply	other threads:[~2017-11-07  8:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 22:09 [PATCH] perf/core: fast breakpoint modification via _IOC_MODIFY_BREAKPOINT Milind Chabbi
2017-11-06 23:16 ` Andi Kleen
2017-11-07  8:15   ` Peter Zijlstra [this message]
2017-11-07 17:09     ` Andi Kleen
2017-11-07  8:14 ` Peter Zijlstra
2017-11-07 15:43   ` Milind Chabbi
2017-11-07 17:24     ` Andi Kleen
2017-11-07 17:42       ` Milind Chabbi
2017-11-07 19:01         ` Peter Zijlstra
2017-11-07 19:31           ` Milind Chabbi
2017-11-08 13:35 ` kbuild test robot
2017-11-08 13:51 ` kbuild test robot
     [not found] <CAMmz+YnaoN3-7DN5WysQvhWNyGhM7_WDz5AQAnvP6FO_GMnMgw@mail.gmail.com>
2017-11-06 15:03 ` Arnaldo Carvalho de Melo
     [not found] <CAMmz+Y=Py0dw63tuww+Oa4rWi_Hghhs3DHmNX=Tf1Yt_JH4O+Q@mail.gmail.com>
2017-11-06  9:23 ` Jiri Olsa
     [not found]   ` <CAMmz+YkB955Na6wOMmgqZX_TxqsBh86FiLi8EXmOrg1vwm-fGA@mail.gmail.com>
2017-11-08 14:15     ` Jiri Olsa
2017-11-08 15:02       ` Milind Chabbi
2017-11-08 15:12         ` Jiri Olsa
2017-11-08 15:51           ` Milind Chabbi
2017-11-08 15:57             ` Jiri Olsa
2017-11-08 16:59               ` Milind Chabbi
2017-11-09  7:52                 ` Jiri Olsa
2017-11-09 13:12                   ` Jiri Olsa
2017-11-09 18:59                     ` Milind Chabbi
2017-11-12 19:09                       ` Milind Chabbi
2017-11-13  7:46                         ` Jiri Olsa
2017-11-13  8:02                           ` Milind Chabbi
2017-11-26 19:31                             ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171107081541.GF3326@worktop \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=chabbi.milind@gmail.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=namhyung@kernel.org \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).