The branch main has been updated by markj:

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

commit e9a846468acfbba35ca40b888670559aaff7228d
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2025-03-23 11:54:59 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2025-03-23 11:54:59 +0000

    ktrace: Use STAILQ_EMPTY_ATOMIC when checking for records in userret()
    
    As in commit 36631977d8c9, this check is unlocked and may trigger
    spurious assertion failures.  Use STAILQ_EMPTY_ATOMIC() here as well.
    Fix nearby whitespace.
    
    Reported by:    syzkaller
    Reviewed by:    olce
    Fixes:          34740937f7a4 ("queue: New debug macros for STAILQ")
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D49441
---
 sys/sys/ktrace.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h
index 9d06cd33d5d2..6608b9250da4 100644
--- a/sys/sys/ktrace.h
+++ b/sys/sys/ktrace.h
@@ -87,10 +87,9 @@ struct ktr_header {
  * is the public interface.
  */
 #define        KTRCHECK(td, type)      ((td)->td_proc->p_traceflag & (1 << 
type))
-#define KTRPOINT(td, type)  (__predict_false(KTRCHECK((td), (type))))
-#define        KTRCHECKDRAIN(td)       (!(STAILQ_EMPTY(&(td)->td_proc->p_ktr)))
+#define        KTRPOINT(td, type)      (__predict_false(KTRCHECK((td), 
(type))))
 #define        KTRUSERRET(td) do {                                             
\
-       if (__predict_false(KTRCHECKDRAIN(td)))                         \
+       if (__predict_false(!STAILQ_EMPTY_ATOMIC(&(td)->td_proc->p_ktr))) \
                ktruserret(td);                                         \
 } while (0)
 

Reply via email to