From de3a5c63f96706b87b708612089c2e168917cf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B8=96=E7=90=A6=5Fhw?= <670097973@qq.com> Date: Thu, 18 Apr 2024 19:32:47 +0800 Subject: [PATCH] current pid verify change to tgid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 杨世琦_hw <670097973@qq.com> --- ucollection/ucollection_process_cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ucollection/ucollection_process_cpu.c b/ucollection/ucollection_process_cpu.c index 339f78a..9fa5d7f 100644 --- a/ucollection/ucollection_process_cpu.c +++ b/ucollection/ucollection_process_cpu.c @@ -224,9 +224,9 @@ static long ioctrl_collect_app_thread_cpu(void __user *argp) } memset(&kentry, 0, sizeof(struct ucollection_thread_cpu_entry)); (void)copy_from_user(&kentry, entry, sizeof(struct ucollection_thread_cpu_entry)); - if (current->pid != kentry.filter.pid || kentry.cur_count >= kentry.total_count) { - pr_err("pid=%d is not self current:%d , or current count over total count" - , kentry.filter.pid, current->pid); + if (current->tgid != kentry.filter.pid || kentry.cur_count >= kentry.total_count) { + pr_err("pid=%d is not self current tgid:%d , or current count over total count" + , kentry.filter.pid, current->tgid); return -EINVAL; } return read_thread_info_locked(&kentry, entry); -- Gitee