From nobody Sat Nov 12 00:01:29 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 4N8G2L1Srqz4dCHy; Sat, 12 Nov 2022 00:01:30 +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 4N8G2L0q5yz3jsg; Sat, 12 Nov 2022 00:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668211290; 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=ecvMXrbXbEtiBPcckmqaU1Q/mv5i1Zu76mnhZ75jkxE=; b=FEXKyKiuweIMI1sMS2O7LSngbNlKFBDRq1QOWxjdYXQrpHaV53+cPE7Qog0cik1tAUT/Kq qo85sHeMy+kIEUTVY8yk2iRNB0UaFHejRkJN1ZdFAp2e1kfhoA5Q7Ma3YqTVZNlnKuop/q zO6PbuJXsDTxoCNg7fOF9Ezhw8w3yaxU2+vP64RT3tOYX9vzIqOGN/bqrTE5YcV2X3rXp+ 1cvun4wwsvYWEvO8r2Ot76hgJ6Qd4pCiVFx7YXNxndIoMM82cM56yPyc6oI4xvInCFc6EY 6TjkKcTP+nwLNYLUedTs/Smt2rlGahHV1wTe0hSZc2h4ZJCdMaZ7/xGEtwFgEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668211290; 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=ecvMXrbXbEtiBPcckmqaU1Q/mv5i1Zu76mnhZ75jkxE=; b=yANLPv0nQh/DLP5PeYLyHlW2yyHyIDJBg6sbMDNSJx10pu6Ah5geOfXxOIgsPfuDgb0EW3 8sQrjKueyzzlShfv0iBqmk0RG/tYiD3+qwSuYo4uUgAihgr5yES6IDCx/8yL2GVYQBfsGT 79//r2sj3qO4WcEy+TnpbueyyjA1cTHgM5jTkHwloCpi/X3+tT8ovn5WorhibG7bxj0ss8 NUAaglm99HMugzcnG5W4QVD6zYcBzJTcLocaTmR39yIs4xtxb5HgViK2j3/LULTLKCYNBO KtxFE23NBSj0PC55YuRouT72iHK/+KkShEqD20nVfkLTUZPnL2v551tunuaH2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668211290; a=rsa-sha256; cv=none; b=nV3mBYaPjtUGO2LgA95CNi2GrQyMdRsQaz24YKL96DCGZOYGef/evtFijkwLVg7biMYpBT NV01ZChkaGu0TbcC0gYE/hC/jkFWUG6SrkvSvGcGHVAeMpn8+7do4rhGY2RnzvqPRBgwQr Ipbl5b2EHuEbt2QzzBOzzng3Sg1uUzsDoukd1E/XDq3epGgkX5MHIND2mmRBcPlZGp+2aZ NPZAP7l5lj5j2ie7ZubKTxvvIC0EczRRnACB3Q6z7J6e0ilBAmaOZqKvShRk93HmQCmyOI HOcov3lfVH5Y7fVTY/4FsYs9nRPW8lQQKCExcQA9cUKfBo8w57Um2KyJAo8HgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N8G2K6zmHz12WN; Sat, 12 Nov 2022 00:01:29 +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 2AC01TSI072560; Sat, 12 Nov 2022 00:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AC01Tch072559; Sat, 12 Nov 2022 00:01:29 GMT (envelope-from git) Date: Sat, 12 Nov 2022 00:01:29 GMT Message-Id: <202211120001.2AC01Tch072559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d01db2b83705 - main - ktls: Don't leak ktls session objects for certain errors. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d01db2b83705eb3557a32ea13143997cdb8135a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d01db2b83705eb3557a32ea13143997cdb8135a3 commit d01db2b83705eb3557a32ea13143997cdb8135a3 Author: John Baldwin AuthorDate: 2022-11-12 00:00:37 +0000 Commit: John Baldwin CommitDate: 2022-11-12 00:00:37 +0000 ktls: Don't leak ktls session objects for certain errors. ktls_cleanup() does not free ktls session objects, it merely cleans (and frees) members of the object. Change callers to use ktls_free() instead. Reviewed by: gallatin, markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37352 --- sys/kern/uipc_ktls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index b4e5004ed1f8..8f3a204cbd84 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -744,7 +744,7 @@ ktls_create_session(struct socket *so, struct tls_enable *en, return (0); out: - ktls_cleanup(tls); + ktls_free(tls); return (error); } @@ -1309,7 +1309,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) error = ktls_ocf_try(so, tls, KTLS_RX); if (error) { - ktls_cleanup(tls); + ktls_free(tls); return (error); } @@ -1387,13 +1387,13 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) error = ktls_try_sw(so, tls, KTLS_TX); if (error) { - ktls_cleanup(tls); + ktls_free(tls); return (error); } error = SOCK_IO_SEND_LOCK(so, SBL_WAIT); if (error) { - ktls_cleanup(tls); + ktls_free(tls); return (error); }