The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cdfcfc607acc10c8b1b2b6a427c9e1ed7e94ebb3
commit cdfcfc607acc10c8b1b2b6a427c9e1ed7e94ebb3 Author: Mark Johnston <ma...@freebsd.org> AuthorDate: 2021-05-03 16:43:00 +0000 Commit: Mark Johnston <ma...@freebsd.org> CommitDate: 2021-05-03 17:24:30 +0000 smp: Initialize arg->cpus sooner in smp_rendezvous_cpus_retry() Otherwise, if !smp_started is true, then smp_rendezvous_cpus_done() will harmlessly perform an atomic RMW on an uninitialized variable. Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/subr_smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 093622d8f6aa..d4f8aac9e751 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -895,6 +895,8 @@ smp_rendezvous_cpus_retry(cpuset_t map, { int cpu; + CPU_COPY(&map, &arg->cpus); + /* * Only one CPU to execute on. */ @@ -914,7 +916,6 @@ smp_rendezvous_cpus_retry(cpuset_t map, * Execute an action on all specified CPUs while retrying until they * all acknowledge completion. */ - CPU_COPY(&map, &arg->cpus); for (;;) { smp_rendezvous_cpus( arg->cpus, _______________________________________________ dev-commits-src-main@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"