提交 db93c085 编写于 作者: C Cheng Jian 提交者: Xie XiuQi

Revert "perf: Paper over the hw.target problems"

euler inclusion
category: bugfix
bugzilla: 9513/11006
CVE: NA
--------------------------------------------------

This reverts commit b772baf9a14ab4975e8884a399a4e0bab2fb6bf9.

we merge the patch b772baf9a14a ("perf: Paper over the
hw.target problems") to reslove an use-after-free issue
(bugzilla #9513/#11006).  but it cause some new problem
(bugzilla #11050/#11049) in this version.

So just revert it.
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 c91d7b3a
...@@ -2104,27 +2104,6 @@ static void perf_remove_from_context(struct perf_event *event, unsigned long fla ...@@ -2104,27 +2104,6 @@ static void perf_remove_from_context(struct perf_event *event, unsigned long fla
event_function_call(event, __perf_remove_from_context, (void *)flags); event_function_call(event, __perf_remove_from_context, (void *)flags);
/*
* This is as passable as any hw.target handling out there;
* hw.target implies task context, therefore, no migration.
* Which means that we can only get here at the teardown.
*/
if (event->hw.target) {
/*
* Now, the problem with, say uprobes, is that they
* use hw.target for context in their ->destroy()
* callbacks. Supposedly, they may need to poke at
* its contents, so better call it while we still
* have the task.
*/
if (event->destroy) {
event->destroy(event);
event->destroy = NULL;
}
put_task_struct(event->hw.target);
event->hw.target = NULL;
}
/* /*
* The above event_function_call() can NO-OP when it hits * The above event_function_call() can NO-OP when it hits
* TASK_TOMBSTONE. In that case we must already have been detached * TASK_TOMBSTONE. In that case we must already have been detached
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册