From nobody Wed Feb 01 23:28:08 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 4P6dQ064h1z3cKQg; Wed, 1 Feb 2023 23:28:08 +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 4P6dQ05d08z3K3Q; Wed, 1 Feb 2023 23:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294088; 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=8HHL0pAzdEFnTEPdvqXL/MHEns6bWueaUF79043J+AU=; b=mTZaJyc7pVLy4U4h7f2wyiFzN/4DKNfKc/w3+FvSO8uKKAfkvO81Rxrz27+hQwhmaamDeZ xn0PYodIrAC4YGGlss6fCuQBnUwtLDWveQSL644pKYCvHBH7bOOxPxC7M5saVfaNSTXNbA bJYy5sEZrcj2AA9sv0x1nyUEnvAiwWeKXnrm1wy14kOn61TDnsE+3E1hijPkmpVpC+0jOF ube+gFw2Ph22g7VGmLh7JwkuHVGZpFEgh4lHrMus/q+s+f2Igd9hmq6gjXBZ5LxK+iY6m/ WvWbeukct6dY5glopxRuGbpvglh+llPG8xjlvFCLKpQ7C8keAj1HjYJXlQysHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294088; 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=8HHL0pAzdEFnTEPdvqXL/MHEns6bWueaUF79043J+AU=; b=Mw85scmpmLqeSMWXT0w+CZrSqG8Nz59LX08rshT3S46IKFLcDAaqf7MMV35F5hei0WFiMz g8y//j2umFtZjw6ocX96uaB9/iiCXbfxLiZbK55hE0qSqYX7b1TgT++/gIeZKjjWzrklbp zAdm/floPrNMdwIBx3JqSuoHf2PQInw3SzogAHcIb7p7cxDMfKuqp/9NZTra9nQO6U9Wmy vz5TcFNT9v4LIrsCu/33I6IwP7EPDCd/Dlks2k5SQxL152/mp/jhwnXC/NvEocU9J51F5M Ch2hXrEd5NgBgoScqURgpgHeJCcCWYtmSTXoXrm+ucKNR1dKrTr4kuYBNQZiPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675294088; a=rsa-sha256; cv=none; b=OmTmywce3cIC1qQkiBLTyWA7Vc5xkhCxLxum1SCdLLCofMkhoLno0NSdA7tIdJi7Zkkscg TmDtiyDS2cWPk2bM+ctn3HYjLFxYPsbYXiby4y1bErS1jD+Dhp4hGjKMjosqQvsuEkCBlR JJQPfgNcfofqs1q/36DPhehLXoFNazVFb8uJeRgBj2nKMRfZJ0zcblAtKOzEKg2jH2+94C U7i+qDA5hSNPpZvu4jNPbMLGdnY5UFhycLRBVSNBbYmd13oTQmVrfJbv53wtsvBI885ukG nBIGZ1VVja+A8N32RGMUf1jLJ9ZaU08+itdyfAR8Gsf6+eI8a0OtVDxfF/nUww== 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 4P6dQ04g1lzXvh; Wed, 1 Feb 2023 23:28:08 +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 311NS834061951; Wed, 1 Feb 2023 23:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311NS8CE061950; Wed, 1 Feb 2023 23:28:08 GMT (envelope-from git) Date: Wed, 1 Feb 2023 23:28:08 GMT Message-Id: <202302012328.311NS8CE061950@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: a00dbd88cc2d - stable/13 - sctp: do not clobber listening socket with sockbuf operations 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: a00dbd88cc2da19a9624f0b24d3d9d4e5a13721a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a00dbd88cc2da19a9624f0b24d3d9d4e5a13721a commit a00dbd88cc2da19a9624f0b24d3d9d4e5a13721a Author: Gleb Smirnoff AuthorDate: 2022-06-27 16:21:45 +0000 Commit: Michael Tuexen CommitDate: 2023-02-01 23:27:30 +0000 sctp: do not clobber listening socket with sockbuf operations The problem was here since 779f106aa16, but a4fc41423f7 turned it into a panic. Reviewed by: tuexen Reported by: syzcaller (cherry picked from commit bafe71fd27201523ae91ef8320f551a609cda1a1) --- sys/netinet/sctp_usrreq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index d7a4d71760a8..7a0b60a9e030 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -560,13 +560,10 @@ sctp_close(struct socket *so) * the SCTP association. */ SOCK_LOCK(so); - SCTP_SB_CLEAR(so->so_snd); - /* - * same for the rcv ones, they are only here for the - * accounting/select. - */ - SCTP_SB_CLEAR(so->so_rcv); - + if (!SOLISTENING(so)) { + SCTP_SB_CLEAR(so->so_snd); + SCTP_SB_CLEAR(so->so_rcv); + } /* Now null out the reference, we are completely detached. */ so->so_pcb = NULL; SOCK_UNLOCK(so);