]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
sctp: make sure new locking requirements are satisfied.
authorMichael Tuexen <tuexen@FreeBSD.org>
Sun, 20 Feb 2022 14:31:53 +0000 (15:31 +0100)
committerMichael Tuexen <tuexen@FreeBSD.org>
Sun, 20 Feb 2022 14:36:26 +0000 (15:36 +0100)
Reported by: syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com
MFC after: 3 days

sys/netinet/sctp_output.c

index 86cf2ed75e90903cc3523dda7f83912e626b495d..43804b161cda7f28ca5f86e9847ae88d7556cb16 100644 (file)
@@ -13321,6 +13321,10 @@ skip_preblock:
                                        sp->processing = 0;
                                }
                                SCTP_TCB_SEND_UNLOCK(stcb);
+                               if (!hold_tcblock) {
+                                       SCTP_TCB_LOCK(stcb);
+                                       hold_tcblock = true;
+                               }
                                goto skip_out_eof;
                        }
                        /* What about the INIT, send it maybe */
@@ -13513,8 +13517,8 @@ skip_preblock:
        if (error != 0) {
                goto out;
        }
-dataless_eof:
 
+dataless_eof:
        KASSERT(stcb != NULL, ("stcb is NULL"));
        KASSERT(hold_tcblock, ("hold_tcblock is false"));
        SCTP_TCB_LOCK_ASSERT(stcb);
@@ -13602,6 +13606,7 @@ dataless_eof:
                        }
                }
        }
+
 skip_out_eof:
        KASSERT(stcb != NULL, ("stcb is NULL"));
        KASSERT(hold_tcblock, ("hold_tcblock is false"));