From nobody Thu May 09 15:49:13 2024 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 4VZxJn477pz5Jxpy; Thu, 09 May 2024 15:49:13 +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 4VZxJn3YNWz4G4W; Thu, 9 May 2024 15:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715269753; 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=1N3IF5c1sVylkx69vI8bV3e278rELblKOQc7qPr+0UE=; b=krl8MPzz+k2zehfgUCZKZ19tTzqsnvWRXmWn7ImrA+2GOfrl6WY60SUG2TOmpurhHgtiMu Uxwbubv7LdPrdsvTSJBtqAKgfXmhEyKIuuZflVSXCkIFcZDa8e9evLv+36RocNSy3Zn9YH qYMhC4nJ1aDOPkD7yxYepKEEtLDmcgoL+e8mq/yFL2RV0jFFfrcAeBJlnTvQBSwlhxfIai j52SWOyZj7iRmGRo+04jdUx+3tbRAHkK4vuVlYYeLfiQQj3DIoTdCV7798RBJ6v3pDL7aI bBcl+1cZQH3DHSZU6+VkVfF5Sx5fUp2bv9UdgU8ESwUs1sV9ncAI6UkWNVeNQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715269753; a=rsa-sha256; cv=none; b=xRLvRWkt2M9QngGosxxQQ66aaaQb1BEDhq1c+l27f5vYzT8QWvUhtpwKrFFv8FjngGgV0w BmmUGA8gRhW8wDhzjfcgn+cKtTTqmCRwUafMUgFsIA2eNDxOuyaUuwN4zMS05N6tRKcSTq 6wtr4+OxuiRQACL7bvzn09xo5bViApuFRsOLbe2Es55Ww4zN76B461mllMke2J1ikn55my qcMhAxX+9/y0Nzi7kdmbqAAtjeVgR1992xwdjYsBrtKK7Cgn3A4dxLCNc+dwEa6znsMlwk EE6AyqdOSHKxPFVrM8Jd3q5HR+9mJlXTusIhlTfacKUz+tVI8mFh/wuOOtdmbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715269753; 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=1N3IF5c1sVylkx69vI8bV3e278rELblKOQc7qPr+0UE=; b=qUxRiendjCJ4O2oJSbrsBaJ0Lb7Kro1Dm1LEHuThhsxZ4N33FmZXq/2Y3SViHtCGTnqCXq R2QGnK6ZBJEGnXWJ2yBaF2eEISL2cy41HyUF5QJbaZHVKkbGwTe4hb8KrBzhG0UCjwQFwe +z0NAR8n6E1UXMuxlGvZcKVX7GGJyNRVd1Iii0jSIxDTOzFK6wzJd+XBimUUryxd5Mp2Se pL+ca+wUWm2qBLaLKexEazv5IR2JpHe8ZC9OWyEEGQnUtXj8JrwQ4ZnQtNvaab1X4HSk1l WAJKDBUJX/2FH2LnMTS2LulexHwr6jpEmWcYzA9AL6JoUPwXdMNPeouUkvpIkA== 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 4VZxJn38DJz1DXB; Thu, 9 May 2024 15:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449FnDoc086368; Thu, 9 May 2024 15:49:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449FnDMi086366; Thu, 9 May 2024 15:49:13 GMT (envelope-from git) Date: Thu, 9 May 2024 15:49:13 GMT Message-Id: <202405091549.449FnDMi086366@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: 8c37094036a5 - main - sctp: allow stcb == NULL in sctp_shutdown() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8c37094036a5f00301c5f5f2be475b664dd5ea23 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8c37094036a5f00301c5f5f2be475b664dd5ea23 commit 8c37094036a5f00301c5f5f2be475b664dd5ea23 Author: Michael Tuexen AuthorDate: 2024-05-08 22:43:28 +0000 Commit: Michael Tuexen CommitDate: 2024-05-08 22:43:28 +0000 sctp: allow stcb == NULL in sctp_shutdown() Consistently handle this case. Reported by: Coverity Scan CID: 1533813 MFC after: 3 days --- sys/netinet/sctp_usrreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 3b0da87edce3..b9a3be5280ae 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -843,8 +843,10 @@ sctp_shutdown(struct socket *so, enum shutdown_how how) } sctp_free_a_readq(stcb, control); } else { - stcb->asoc.size_on_all_streams += - control->length; + if (stcb != NULL) { + stcb->asoc.size_on_all_streams += + control->length; + } } } SOCK_UNLOCK(so);