Unverified Commit ac3aec76 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15331 Fixes CVE-2025-21767

Merge Pull Request from: @ci-robot 
 
PR sync from: Yang Yingliang <yangyingliang@huawei.com>
https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/Y5SGQWMLNKWRSF7NILCJBHC3OK4L2JP3/ 
Waiman Long (2):
  clocksource: Use pr_info() for "Checking clocksource synchronization"
    message
  clocksource: Use migrate_disable() to avoid calling get_random_u32()
    in atomic context

 
https://gitee.com/src-openeuler/kernel/issues/IBPC76 
 
Link:https://gitee.com/openeuler/kernel/pulls/15331

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 2e485a96 dafc31e7
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -351,16 +351,18 @@ void clocksource_verify_percpu(struct clocksource *cs)
	cpumask_clear(&cpus_ahead);
	cpumask_clear(&cpus_behind);
	cpus_read_lock();
	preempt_disable();
	migrate_disable();
	clocksource_verify_choose_cpus();
	if (cpumask_empty(&cpus_chosen)) {
		preempt_enable();
		migrate_enable();
		cpus_read_unlock();
		pr_warn("Not enough CPUs to check clocksource '%s'.\n", cs->name);
		return;
	}
	testcpu = smp_processor_id();
	pr_warn("Checking clocksource %s synchronization from CPU %d to CPUs %*pbl.\n", cs->name, testcpu, cpumask_pr_args(&cpus_chosen));
	pr_info("Checking clocksource %s synchronization from CPU %d to CPUs %*pbl.\n",
		cs->name, testcpu, cpumask_pr_args(&cpus_chosen));
	preempt_disable();
	for_each_cpu(cpu, &cpus_chosen) {
		if (cpu == testcpu)
			continue;
@@ -380,6 +382,7 @@ void clocksource_verify_percpu(struct clocksource *cs)
			cs_nsec_min = cs_nsec;
	}
	preempt_enable();
	migrate_enable();
	cpus_read_unlock();
	if (!cpumask_empty(&cpus_ahead))
		pr_warn("        CPUs %*pbl ahead of CPU %d for clocksource %s.\n",