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: <20110325191034.GA26454@redhat.com>
Date:	Fri, 25 Mar 2011 20:10:34 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH,RFC] perf: panic due to inclied cpu context task_ctx
	value

On 03/24, Jiri Olsa wrote:
>
> - close is called on event on CPU 0:
> 	- the task is scheduled on CPU 0
> 	- __perf_event_task_sched_in is called
> 	- cpuctx->task_ctx is set
> 	- perf_sched_events jump label is decremented and == 0
> 	- __perf_event_task_sched_out is not called
> 	- cpuctx->task_ctx on CPU 0 stays set

I think you are right.

And this is already wrong afaics, even if we add the workaround into
free_ctx/etc.

For example, suppose that we attach another PERF_ATTACH_TASK counter
to this task later. perf_sched_events will be incremented again, but
perf_install_in_context() should hang retrying until this task runs
again, ->is_active == T.

Or, even if sys_perf_event_open() succeeds the next
perf_event_context_sched_in() will do nothing because it checks
cpuctx->task_ctx != ctx (unless another task has a counter and
schedules in on that CPU).

This should be fixed somehow, but so far I have no ideas.

Oleg.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ