From nobody Wed Feb 01 22:45:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P6cSq1BYRz3cF1Y; Wed, 1 Feb 2023 22:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P6cSq0jWCz4NBN; Wed, 1 Feb 2023 22:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675291531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggoJydswjwWi7eeUJUFqSC5lrm3I2rCIanQfS5+1k5o=; b=kxNbJTT7Orr6iG5uuUFYKzou6etlggxjuIBwevDFO8pcDPlSQZ8met7eytgC9syMSps97k O5CDiXYx+A0LIPOgbCmvIiwZftuW1ra0QRsvo9oQGtZlbOpCNlpCDU1DnuqdRDpEPRyPhs Ati6iGzc+riAU82Vr5Rc3cm/aOAfSfgZiCS387VL4onaW3CKm0Zo37ZxgZjhOiGH+CDPza 3Dy+NM/s9zZOVpgV9qAwXJ87WHhw3P7Vmx9Ul796HtKIPngSffuyd/FvV0/9XDsAb2kCFv ao+1LLtZxVBBXHhwBJNmqF+9JBMXVBpnBieCbFHt5Fjh6N4oMxRwCkMVecUrNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675291531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggoJydswjwWi7eeUJUFqSC5lrm3I2rCIanQfS5+1k5o=; b=Z/mJLuzVAv1Ri17C2ycg07hap2EU0j46HHPReWIkDAH02HK4Tyr/8ujv2Ff7t3vzgczyfW eTwt6UhDIJI1ntGGeD9kGun377ihuWZpX55sLTHOYK3sU+1+//KDBaO+/b0RstKYrRlH7Q Q8zvCG8wcQ4LefU+aXHwRXlu8TX6sYCIFDStQmU4K8qiiJbsXf52Ek3EYKNgTflL7se8re tpdct/ud5T0SY63uYft0ri56xTsf1LfmQG7io2IFD8S+PVzDbU4GOmfvHlwuJ2kc+mW7mB 7kWdpEBe2owBFzaL9j7YUAUA7SVA9H0jS3pt84OLKaoZEc0+5ZgZdVT+hVj3Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675291531; a=rsa-sha256; cv=none; b=WKc5+bLdBuN77bycMkORdI/VpL8nMK5uUZPTtmH4PE8rGjvpb+JC3y6+yZ6IoLBERCLnu0 T1R4hloQoE69iR0peESxZnkGIcIHKWbOur+mx/0onmqWMiD/bRh/MDvpE1ir0Vq3PbxHBz RIymV8xVB81G4THJxJprXSAhJOIqwb1GEYD61SOZRytdzu1ZMAcBY3BM/k76EsdU8Tr7ZI gfvEylpRfUCtyI545FqoZQ857IRTFeFcqKROFeJXqHOwdlPb3RZWZcm4scARWa3JQyPh2m NWf9FIzuARfZnlL2Rls5SeIofOXAjoGXUbltA+pjto1Dj8xj6YEDmYaQMviTUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P6cSp6tmJzWmY; Wed, 1 Feb 2023 22:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 311MjUAm002453; Wed, 1 Feb 2023 22:45:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311MjUPQ002452; Wed, 1 Feb 2023 22:45:30 GMT (envelope-from git) Date: Wed, 1 Feb 2023 22:45:30 GMT Message-Id: <202302012245.311MjUPQ002452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2a93ba42c49a - stable/13 - sctp: improve stopping of timers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a93ba42c49a130bc56cb3cf2092a8e35a8d2b04 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2a93ba42c49a130bc56cb3cf2092a8e35a8d2b04 commit 2a93ba42c49a130bc56cb3cf2092a8e35a8d2b04 Author: Michael Tuexen AuthorDate: 2022-04-19 19:29:41 +0000 Commit: Michael Tuexen CommitDate: 2023-02-01 22:45:08 +0000 sctp: improve stopping of timers Reported by: syzbot+c9c70062320aaad19de7@syzkaller.appspotmail.com MFC after: 3 days (cherry picked from commit 868868f14efcd7e127dae6e87550357c6cdb9c6d) --- sys/netinet/sctputil.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 45e06ef769e0..5f18e564cf21 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2869,20 +2869,23 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, * counts that were incremented in sctp_timer_start(). */ if (tmr->ep != NULL) { - SCTP_INP_DECR_REF(inp); tmr->ep = NULL; + SCTP_INP_DECR_REF(inp); } if (tmr->tcb != NULL) { - atomic_subtract_int(&stcb->asoc.refcnt, 1); tmr->tcb = NULL; + atomic_subtract_int(&stcb->asoc.refcnt, 1); } if (tmr->net != NULL) { + struct sctp_nets *tmr_net; + /* * Can't use net, since it doesn't work for * SCTP_TIMER_TYPE_ASCONF. */ - sctp_free_remote_addr((struct sctp_nets *)tmr->net); + tmr_net = tmr->net; tmr->net = NULL; + sctp_free_remote_addr((struct sctp_nets *)tmr_net); } } else { SCTPDBG(SCTP_DEBUG_TIMER2,