From nobody Mon Aug 08 18:22:23 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 4M1l0w0325z4YkXk; Mon, 8 Aug 2022 18:22:24 +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 4M1l0v6jSSz3XDD; Mon, 8 Aug 2022 18:22:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982943; 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=aJqvjBPchQCli05rvzLalfoL3phsayo18lyQJ7zU/F0=; b=TU5txp3wa+08scErB0YM7CSYB6hv8zTAmTa1+5Zndn8ZLaRdmc3knW1kb1svvD8m7QSfqr o/DOaUWSz9XFFVsOpQtrpwnEOd5b5bAPIabKMqXLkZgFNoyqdjSD38XTj0n2tjLGXr0lFa 7Q3lqhgeuJgFyi057zsPUW394y5IgZ+sA3yFpyCW5ZRMA9RGdmtcfqDXJwt26EnZof5SV8 6deRKqZiCGAiXspI+ngo835IbFdl/oHt/fIHBw/gQg7SoQ8xPQMh/DDUzjflKP0dO0a4X8 6ps1xUUM1Neywa2urFG84uyNEJOHQwN7/L1IsGwt3lPDiE3ANgBlX6EZBftRIQ== 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 4M1l0v5hDMz123W; Mon, 8 Aug 2022 18:22:23 +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 278IMNmN041334; Mon, 8 Aug 2022 18:22:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 278IMNnL041319; Mon, 8 Aug 2022 18:22:23 GMT (envelope-from git) Date: Mon, 8 Aug 2022 18:22:23 GMT Message-Id: <202208081822.278IMNnL041319@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: 1ca4f45ea89f - main - cxgbe: Handle requests for TLS key allocations with no TLS key storage. 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: 1ca4f45ea89f10621bf7e9cfea1705d0a7940bea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982943; 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=aJqvjBPchQCli05rvzLalfoL3phsayo18lyQJ7zU/F0=; b=VEQIB1DgVVu5X2fT4+deYEtE2Fl6u5N/2TaV9BuMOe+biQs3nO4DJ1/WgBJjO3lXgFxIiL Q54WwGBXBp+fNcS/8k5lbhAohwy/Xb8MKDWp6simm78qARYiGwkZHGPEqWr5jlDeS9pAqZ IiqffalncBxhVFsUv5PSDFuozdgvD9Qi0Xd+dJTDUpiGCcj4Xp1UEJuw7YGTFUQ8e6rVqs 4Gy/Y+JHSUrXimI/HwUPEhMhv6OYZa2vIWzrB05J/JQbtBiihTq43viXRI8nSA3H8UmkP5 tkxGR1ffBRoQgt7sa+u4ue0S6Y2hUmZZbhyCGQFMmgGZEnlgMJF7f2L7eTvycg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659982943; a=rsa-sha256; cv=none; b=bg7wER9XyGI8aa3ACuJn5lODoz+w/3rDPIA0thLPmx/GWrhacdeFBw1KorzIVM7s95vhlJ UGxo7oypnpx2g3LbhK2cfzPliqi3wK2fsZpjH+5RcCH2nI/a5DazQKlRqHfPO2LZjo+tGF jlnHGU2yP+E6exPHM6H40qInJdH4Sk2VSi5yYjrvJZfA+e8PMA9NHVw+M5Clnc/pNNCJPo 2CeiukPxGgyu8Q1kNGI6vda/OycTybTsitr5yvZB2cXT9/mpLaaNggQ+ECa+mO3Nm2hib9 vD5hBYPT9YrPUSZOPVRlVjHXFZlKL9ILJZVFiwXmjkqbz/AyGuVgZC3/ET5Usg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ca4f45ea89f10621bf7e9cfea1705d0a7940bea commit 1ca4f45ea89f10621bf7e9cfea1705d0a7940bea Author: John Baldwin AuthorDate: 2022-08-08 18:21:54 +0000 Commit: John Baldwin CommitDate: 2022-08-08 18:21:54 +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 --- 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 136aba759a08..a5b15e5243eb 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);