The branch stable/13 has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=44d26e9e781fdf47fe0e1e6c987d519a751b14fa

commit 44d26e9e781fdf47fe0e1e6c987d519a751b14fa
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2021-05-03 16:43:00 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2021-05-10 13:35:53 +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
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit cdfcfc607acc10c8b1b2b6a427c9e1ed7e94ebb3)
---
 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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to