git: 51489b9ced27 - stable/14 - ktrace: Use STAILQ_EMPTY_ATOMIC when checking for records in userret()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 06 Apr 2025 22:51:13 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=51489b9ced27afdf9ea34edc65c8c31274ccc9c5 commit 51489b9ced27afdf9ea34edc65c8c31274ccc9c5 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2025-03-23 11:54:59 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2025-04-06 13:54:13 +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 (cherry picked from commit e9a846468acfbba35ca40b888670559aaff7228d) --- 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 2618c7c719b3..b615d82d2198 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -89,10 +89,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)