From nobody Mon Jun 27 16:25:02 2022 X-Original-To: dev-commits-src-main@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 066F9875A18; Mon, 27 Jun 2022 16:25:03 +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 4LWtNt6pX4z4kCB; Mon, 27 Jun 2022 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656347103; 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=AJfKBdTGMCb3FN4DWJGNGc6/vlooW4lPOeshBo/an/U=; b=xLNWvEiZ6Whm5jfxoLn7u7LPZUb9A4nOJGRX1mW7RkptqXUgdBjc6VIJ3gC+HAn1EeCjj2 aucpM7PKIMOBVMtmcuLvKRVWyuBLu75a6+Vb6OhEOmty1d8iK7hc29ri6FdN9MCYg+Q0Go d+oaWxuX+Ed6ELRJ4mHmKiHe54pwv6I8Q+LcGpJ9ksmO1WbAoWNtT60I/BFejutWWZufLz 4rHkCME11yNPA6ax4H+ckxuLbT1JOfRBeZBhfwhnFIuBTh3n4TThk5SVhjqaMEyfCppKyK WvHFAkpibfrkGqxzXB0qbyUyhcmNboj1lHOzc36oIZhxZdc/haNzu+uQTGl0sA== 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 C9CC93840; Mon, 27 Jun 2022 16:25:02 +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 25RGP2H2060157; Mon, 27 Jun 2022 16:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25RGP2hs060156; Mon, 27 Jun 2022 16:25:02 GMT (envelope-from git) Date: Mon, 27 Jun 2022 16:25:02 GMT Message-Id: <202206271625.25RGP2hs060156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: bafe71fd2720 - main - sctp: do not clobber listening socket with sockbuf operations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bafe71fd27201523ae91ef8320f551a609cda1a1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656347103; 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=AJfKBdTGMCb3FN4DWJGNGc6/vlooW4lPOeshBo/an/U=; b=OBc7qAy4iGplUinSmmO4WHtbaxi0LbLENOTtuIRaIF4waQYr9QDnif5dh/JBzKtYcMQp9b CuqwtQ7AttcDLiSReQ7JPeR0PZDU77VxjAhhr0k+C6dM0D5Ns7CTp8u5mz/E+gWVe2iTSZ jBb0Nuul8xKBVffCHywN7QvmT4Qj/GJ8aMiyeN80I6geEIw2D4UNFQ0Fl1xI4rakX8XBUT wsm8udRFK6PKu09x7nqG78cuQ9f9BStjc5/0yLic4BgEVU2ujvDEASFEhQ33BFsX8ZX2WC +a4MbouY/7jS4zT/Hcljew7gAzkC81CssCQXZZt6lCvldkBtS7OGu49BIUMaww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656347103; a=rsa-sha256; cv=none; b=NB7799wkQ68SUaLeHihxsRe0hluequHr2+blePO/M8aXo2HfA+uD+i+F5RndqQkYpkchOn JJU+0wekW7q2H9iUVyWk4jWw8RY6FSVZksdXLYGzvlk1poxXmrsD5Z3B5iVmElPcGYp7ah ZR+fPf2H4nd7TgEdmOwxOQn+TmVZ790Cf7s1oMWrJ01QSLM5SYU/pU9/l3ke8tKVu3qC3N heJsNMNtUVu/O3kcLpSOTnzsC/VQ9Hy+P8CZ4ni5awHQlHpnaFRf2io9GyPues354loN3+ mr7KhRVX9oGCMqJJ9JgseOVNM+NtC4z9q1i4c5qdlKre6dzOvgWbqBRtfbdxyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=bafe71fd27201523ae91ef8320f551a609cda1a1 commit bafe71fd27201523ae91ef8320f551a609cda1a1 Author: Gleb Smirnoff AuthorDate: 2022-06-27 16:21:45 +0000 Commit: Gleb Smirnoff CommitDate: 2022-06-27 16:24:49 +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 --- 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 caa763f28c8a..90c019ef2afd 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -565,13 +565,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);