From 1baa4ff23d2344ef92efb9f5b2495387b6240b4d Mon Sep 17 00:00:00 2001 From: y30015170 <1169998606@qq.com> Date: Fri, 30 May 2025 12:20:54 +0800 Subject: [PATCH] =?UTF-8?q?Description:=20sched=5Fsetscheduler=20=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=A0=A1=E9=AA=8C=E4=B8=8D=E5=85=A8=E6=BC=8F=E6=B4=9E?= =?UTF-8?q?=20IssueNo:=20Feature=20or=20Bugfix:=20Bugfix=20Binary=20Source?= =?UTF-8?q?:=20No=20Signed-off-by:=20y30015170=20<1169998606@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- syscall/process_syscall.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/syscall/process_syscall.c b/syscall/process_syscall.c index 59d914f7..7f6dd877 100644 --- a/syscall/process_syscall.c +++ b/syscall/process_syscall.c @@ -109,17 +109,17 @@ static int OsUserTaskSchedulerSet(unsigned int tid, int policy, const LosSchedPa } taskCB->ops->schedParamGet(taskCB, ¶m); +#ifdef LOSCFG_SECURITY_CAPABILITY + /* user mode process with privilege of CAP_SCHED_SETPRIORITY can change the priority */ + if (!IsCapPermit(CAP_SCHED_SETPRIORITY)) { + SCHEDULER_UNLOCK(intSave); + return EPERM; + } +#endif param.policy = (policyFlag == true) ? (UINT16)policy : param.policy; if ((param.policy == LOS_SCHED_RR) || (param.policy == LOS_SCHED_FIFO)) { param.priority = schedParam->priority; } else if (param.policy == LOS_SCHED_DEADLINE) { -#ifdef LOSCFG_SECURITY_CAPABILITY - /* user mode process with privilege of CAP_SCHED_SETPRIORITY can change the priority */ - if (!IsCapPermit(CAP_SCHED_SETPRIORITY)) { - SCHEDULER_UNLOCK(intSave); - return EPERM; - } -#endif param.runTimeUs = schedParam->runTimeUs; param.deadlineUs = schedParam->deadlineUs; param.periodUs = schedParam->periodUs; -- Gitee