From nobody Tue Apr 19 19:31:27 2022 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 03805137615A; Tue, 19 Apr 2022 19:31:28 +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 4KjYnq6g7Zz4dvf; Tue, 19 Apr 2022 19:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650396687; 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=4tUsUsu0bPyUU8KC3I2ys0BsDjvx8nhIECAFEMPXIi0=; b=oSVi230VrVzQzhVvhNk0VakNG98uRwlBH0zH9e9sbiznjUJ4CQbhpeOeDEX5LN43FYvrsV tOPg25/HW7RURbmpOHJ4L6wtBpsZmZVqgqT3KheMle5Z5vnI3xSv8I2QMEf2lmC/q/+dFy WH+uVSEvXHAZXUD2h2t7V2dMpS69l9hjQGgbXZHWvLP3sxEMVGVddfFitxSXpG7y70pTzK NS1vOtcmyqFHmcS5zRYlgCL1Ma+CtaivyGhaUKd81P3V0RZ8toZqhnvYNUn+nrdJ8dDAJf Br7hpR6DMuAXQVCApqVF80oo/zY0L7/ajiwGPpn8im2wkWMDZj8zr7HXlL/IqQ== 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 C49322D341; Tue, 19 Apr 2022 19:31:27 +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 23JJVR6P082460; Tue, 19 Apr 2022 19:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23JJVRqX082459; Tue, 19 Apr 2022 19:31:27 GMT (envelope-from git) Date: Tue, 19 Apr 2022 19:31:27 GMT Message-Id: <202204191931.23JJVRqX082459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 868868f14efc - main - 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/main X-Git-Reftype: branch X-Git-Commit: 868868f14efcd7e127dae6e87550357c6cdb9c6d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650396687; 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=4tUsUsu0bPyUU8KC3I2ys0BsDjvx8nhIECAFEMPXIi0=; b=G0fNfit8oqCmecUZnMX8jfIBp2kponkqlyvqVMKOLUFF45NS2wwLfJHxsaSPPUSZqJsySs QLQeqQB53r65pDbVyDSS3hIz9hyLTeXnyjcZjcrunlk4BVbrGonU5UN0bYW0/9eOA1n9tB OAaXy1HFbIh19T5SO/RY53Kpt1jGPIk63lDzqVYzCF66TQifI5eTd0jmCDvC6upxsBZcbU jXC16fY9xgiCQ3OCEX2gvU0K0bUK/j4zJu1IHg9O6vN0CGMwLq81Ke3mMK4TZUei3irbku Tt4l2ElY0xjcs6UePuYGDyqZapMdP75bjsl+vIBsbrS/DjSF6y6klvtOCprcXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650396687; a=rsa-sha256; cv=none; b=TAipXIoXYuKIXcauvEo5bmYSSOKVIJ3iopDi7+oDbu4rR365Ql9g/3k8O65ZJB4f7Yo76F lrvO8jMAbZKfoTgQyhLhEFbfapQKIoD7qLQoW3BWbhUqJzMxbrNvQG8o6rnnHomPiPcOer PysfbWHBkDY8l79/5u/4FZT89w6tOVNs5WKsdwti2NKwmaOXKuY9ZEOvRvWbx57bJoQGu4 m62QXX3/pCKmnke4ydB0zGR3qaJpJvw3oYfmxpvdJz+9AUwgDUnRsEnQC86fR5ZBO8M715 uQ04iC5lHV/wm7WCf3vngRV+QP4q98YAZorPUewVf/7U+hWpB/FXTM7MdM3Asg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=868868f14efcd7e127dae6e87550357c6cdb9c6d commit 868868f14efcd7e127dae6e87550357c6cdb9c6d Author: Michael Tuexen AuthorDate: 2022-04-19 19:29:41 +0000 Commit: Michael Tuexen CommitDate: 2022-04-19 19:29:41 +0000 sctp: improve stopping of timers Reported by: syzbot+c9c70062320aaad19de7@syzkaller.appspotmail.com MFC after: 3 days --- 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 8c96a832827a..49a8abbc9ccf 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,