[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLzUuR6wM=hOybM25d21PN=Fax5Ms7z2XeArTwAhZ6zqQ@mail.gmail.com>
Date: Wed, 6 Jan 2016 13:56:56 -0500
From: Eric Dumazet <edumazet@...gle.com>
To: syzkaller <syzkaller@...glegroups.com>,
Eric Dumazet <edumazet@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>, acme@...hat.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
Alexander Potapenko <glider@...gle.com>,
Kostya Serebryany <kcc@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Sasha Levin <sasha.levin@...cle.com>,
"H. Peter Anvin" <hpa@...or.com>, jolsa@...hat.com,
Ingo Molnar <mingo@...nel.org>, vincent.weaver@...ne.edu,
Thomas Gleixner <tglx@...utronix.de>, acme@...nel.org,
Stephane Eranian <eranian@...gle.com>
Cc: linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf: Fix race in perf_event_exec()
On Wed, Jan 6, 2016 at 1:46 PM, tip-bot for Peter Zijlstra
<tipbot@...or.com> wrote:
>
> This is because context switches can swap the task_struct::perf_event_ctxp[]
> pointer around. Therefore you have to either disable preemption when looking
> at current, or hold ctx->lock.
>
>
> void perf_event_exec(void)
> {
> - struct perf_event_context *ctx;
> int ctxn;
>
> rcu_read_lock();
Do we still need this rcu_read_lock(), if perf_event_enable_on_exec()
uses local_irq_save( ?
> - for_each_task_context_nr(ctxn) {
> - ctx = current->perf_event_ctxp[ctxn];
> - if (!ctx)
> - continue;
> -
> - perf_event_enable_on_exec(ctx);
> - }
> + for_each_task_context_nr(ctxn)
> + perf_event_enable_on_exec(ctxn);
> rcu_read_unlock();
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists