git: 38479a483278 - main - sctp: improve locking validation

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Fri, 16 Oct 2026 07:49:31 UTC
The branch main has been updated by tuexen:

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

commit 38479a4832789c239eb1ff097ee51e93e8084315
Author:     Lukas Book <lkbook@outlook.de>
AuthorDate: 2026-10-16 07:46:16 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-10-16 07:46:16 +0000

    sctp: improve locking validation
    
    Ensure that the TCB lock is hold in sctp_calc_rwnd().
    
    Reviewed by:    tuexen
    MFC after:      1 week
    MFC to:         stable/14
    MFC to:         stable/15
---
 sys/netinet/sctp_indata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index 693de313b970..12ebfd007e53 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -77,6 +77,8 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
 {
 	uint32_t calc = 0;
 
+	SCTP_TCB_LOCK_ASSERT(stcb);
+
 	/*
 	 * This is really set wrong with respect to a 1-2-m socket. Since
 	 * the sb_cc is the count that everyone as put up. When we re-write