From nobody Fri Nov 11 00:39:05 2022 X-Original-To: dev-commits-src-branches@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 4N7fwB29dZz4dbXk; Fri, 11 Nov 2022 00:39:06 +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 4N7fwB1VsYz4chW; Fri, 11 Nov 2022 00:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668127146; 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=qjb7fKe3kJqc0aW58KTsXfmEUeJud9D7QfPI5g49k54=; b=GuiA9IgVzVKaQgu0+OvfysOVrFl49n1PwZDHzIvL5LhqXRBDBGFZTTkPiQmBRkFFQHiRKB ySKMaYa3bG6E+anPNDLwC5b28pEu0MGmhBrjsnH5DUbUaZYilnQIaj5GaLbqA3E/RX83CM yKIU+eg7Fozp66xIo5GK315kt3OGNIqYnNIiisdT1zLK27BaEx11r/ewbJZzO2lVpRb/2E HT9lxXjWWsUglnI6BN/rgFazlHzwm/vMnJblowvV9lqot89Zt0fjtHlheBHkN2y55Xmap2 8ov7BbkI8HgbtLSBtZMFdCrj8g+w+oW3yYiqakfQ2T1ic1o4OM4P/hFgBLQDMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668127146; 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=qjb7fKe3kJqc0aW58KTsXfmEUeJud9D7QfPI5g49k54=; b=YMgCQQzlRBJjS5P86PbGXR7pFYGkup132bpNhNjGByPSQabyMExyw1g6CE+faXfbz+unVe gUuGrW5m3h0F/EKr9zZWnqSF/piz4ZKzWvOw5mg4TEEmfykL+7vYTm8lEcG3thZiqRLXA7 OgjDzjaHd3yTzCFYt8J/gDMAvt/o3m1PsaVykmJbpgZMd0c2XkS1GAvBZimGeHVbpu0yQa TfLbwtBxpDnLd1+8UGL5IPnemTwad2frF6aCWY2967yOuqadoSsBYzkH/M07w6Z4/Goill 9j5pyB4VK7FjHYOY66Ct4qVsGriztHOiWxxzHpCUoAK9S9Z5CqMwn1WtS8xmCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668127146; a=rsa-sha256; cv=none; b=fPnH27KllXE60MxszcBpaS4rJVic12ej005uA2gz0O97trmPVNFVK9Cp54cfb84JVk0CXR D4p2O9ARROhfln7+0b7KNWluaGt3QsEWBYPWMPK7GoMdWRly0DD2ICm5pvO0BH9wr/sUgC 4jlXf3CB1Ac1S3R2/hZUVZITYp4KJX6qloiiKKHpVxXRNV2iodmw3FUZV9NTN9gh0uYlMa nsZkrBv9w0JuWI7aC5A4wYZREDaOuUk+KmFfbY+Gu9AzqkbpMOR2Kh0dFHDy1YJauXakDp 67AE3mvInDdTpzDlAY/os0ZEqB/IA2r+H/7XMc5MK8BUc4oq7KJt43DbKu28kA== 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 4N7fwB08GGzM70; Fri, 11 Nov 2022 00:39:06 +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 2AB0d5k4057354; Fri, 11 Nov 2022 00:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AB0d5YJ057353; Fri, 11 Nov 2022 00:39:05 GMT (envelope-from git) Date: Fri, 11 Nov 2022 00:39:05 GMT Message-Id: <202211110039.2AB0d5YJ057353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 034af6afc542 - stable/13 - cxgbe: Handle requests for TLS key allocations with no TLS key storage. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 034af6afc542948b534176a037a990a255ea73f0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=034af6afc542948b534176a037a990a255ea73f0 commit 034af6afc542948b534176a037a990a255ea73f0 Author: John Baldwin AuthorDate: 2022-08-08 18:21:54 +0000 Commit: John Baldwin CommitDate: 2022-11-11 00:35:47 +0000 cxgbe: Handle requests for TLS key allocations with no TLS key storage. If an adapter advertises support for TLS keys but an empty TLS key storage area in on-board memory, fail the request rather than invoking vmem_alloc on an uninitialized vmem. Sponsored by: Chelsio Communications (cherry picked from commit 1ca4f45ea89f10621bf7e9cfea1705d0a7940bea) --- sys/dev/cxgbe/crypto/t4_keyctx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/cxgbe/crypto/t4_keyctx.c b/sys/dev/cxgbe/crypto/t4_keyctx.c index b64eb4ff23d7..11f5598c31a5 100644 --- a/sys/dev/cxgbe/crypto/t4_keyctx.c +++ b/sys/dev/cxgbe/crypto/t4_keyctx.c @@ -640,6 +640,9 @@ t4_alloc_tls_keyid(struct adapter *sc) { vmem_addr_t addr; + if (sc->vres.key.size == 0) + return (-1); + if (vmem_alloc(sc->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | M_FIRSTFIT, &addr) != 0) return (-1);