
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICA1GK -------------------------------- As the title says, in case of tsk == NULL, task_effective_cpumask() should return right after clearing pmask to all 0. Otherwise null pointer dereference may occur. Fixes: 0ea52fdbeffa ("cpuset: Add task_effective_cpumask()") Signed-off-by: GONG Ruiqi <gongruiqi1@huawei.com> --- kernel/cgroup/cpuset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 417827f2c043..ccf74e7cb33f 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -5212,8 +5212,10 @@ void task_effective_cpumask(struct task_struct *tsk, struct cpumask *pmask) { struct cpuset *cs; - if (!tsk) + if (!tsk) { cpumask_clear(pmask); + return; + } rcu_read_lock(); cs = task_cs(tsk); -- 2.25.1