Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp793465lqo; Fri, 17 May 2024 01:27:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9PVs/uI0UQ0UTYqvLtyYMEUBcDmPdsWZIvm7g5zL507U1skKzmIWbCP33RZ/3IFGoHA/SCyhyKcPdYgXutAHoecdchXYK2Ji09aMX0Q== X-Google-Smtp-Source: AGHT+IHnW3Tbn9AC+gQRIe+Yitw5aKZBks0HexZ3YxJzuP/beheKUbKab/5D9ufXfBzloEHFsTcZ X-Received: by 2002:a05:6a00:4b06:b0:6f0:c828:87ef with SMTP id d2e1a72fcca58-6f4e02981f4mr21635862b3a.3.1715934450661; Fri, 17 May 2024 01:27:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715934450; cv=pass; d=google.com; s=arc-20160816; b=Ye8SNIv1NT+YL3KjRdpLONyV1Af6XtsiOJvwSVl70tu5X0+MU2vUzMejv4n/zNQJqS J7/0UYA4if3eRtJaR0q0AuL3AtT/h7dRe0mUy2Krm5Sco+xU/ZpQpb+tMztsFOGnh1tU UmAECfXBX3d9SYFrn/UDqtHNWPrwVyZ3W/9fbb+/wm46xnwLQDmg84An62f33rbjen8e neFDXYaaKZolO2JoDgppkK8VD9i+u4zBWrxQAqvYz/MN7ZUjE0FeJ2OBUl78HHE6hih+ IKbomH8GpRkjrBAMvtHtbyQekL0Kd9Wq8W76JMjhRrPmqUApBf8wQibzIcrHZ7wdjLqz 5CdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=ppoEICDtMB3DxtR9T1dITbBZhbxnHTvy0Lb1kS2zBpE=; fh=chjqxA+AILGjKw3hoYmCa2AxfpN8HPTpRqDxUvhqwAE=; b=ospvsWptsI7rPDg5vXzaFeY+8IU/U2YDiTp/cOnXNP+3kmzBH3KfAQMhAbkdRlY7hd glH48azG4fWX/B87GH82HPE9wWrxYmatMqWT2fUDLUNN1jNsPjOfevWgSdNb2VG3A5AX jElfHZ84K+zJZn9V8LvSqZlkk/3NbP5q/1TR/0jLZUqZcaMvdL6t0uHMgEn/HbjCZ+BY wpkjJIr9oT9EnlS2ReeolIzt3+EjJDR5Mg/F6m5FaEVEfawRs6Z5rM7Zy+J1TqMaOWs/ veYauEfltfJpkABvsg3hDjsO9LgIwy/Fl45ZHhR7/B4uF0x+iteFJuYkZOwxCqnY/h3P pOCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dFahYnI8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6479a59ce9asi3983435a12.526.2024.05.17.01.27.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 01:27:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dFahYnI8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 42B1CB20FB5 for ; Fri, 17 May 2024 08:26:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FE35224EA; Fri, 17 May 2024 08:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dFahYnI8" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11CFA2208F; Fri, 17 May 2024 08:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715934398; cv=none; b=H+WdqRjN3id96RBRXr6T0nA8iUtYib3SFAGL+QKmzOqfl7MT6t6M1W4+u/FEf42qMBGnFaz5R/rWOnp9XvPGVxTFdhQgGqInZ0HJb3ocPa/Juo2ppYUXXeMSNsyVerYAynJiulP6CJs4YYuw0EoSce1BOQHtoD6w4fFJDzM+Xhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715934398; c=relaxed/simple; bh=b4CzBIuUjatTBApFL7zeTDMeXO1kQQLfnt2eCZBNbLM=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=D3YGooqetzZrHWFv8UCk6kmobNFfFIOpKW6d5UqKdE7NgMNZ/ELY4oTLIXPYoqE8MFTnogs1GgNAC4f8i4PH5BKd6n1cJzYwTyZBGsW44LH+wF4HYJNAj0uFAzE+8jqHqRNU+uzCixZhjezVZa5T9RhIpPLE8cSBzjbgu9MR++M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dFahYnI8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5A02C2BD10; Fri, 17 May 2024 08:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715934397; bh=b4CzBIuUjatTBApFL7zeTDMeXO1kQQLfnt2eCZBNbLM=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=dFahYnI8viyUXccihZsL3aSFRGse+6uwl/zuok8MimuM94Hh7rpCxmCIAtgHtyXlt xcG0g3GpN/eFcuJyzYLSh7HkwfGEHyqKTABf5b0nT3Lkncko9a2lrmlWmYRwUWuboM ZH+IN0cYTYFwHUArujOcrtwlDpUX6CiDIeHldW/eSAL1SAjfx3RtDqhhxG5I7wY+Xf ImoZq4csqGm5pann9Pq9cO3aDqXxUbeHinaPadqulcF6/6Dzlv7MbM2H4uikRFjdeR 1JeEKcsNoZKteDpD9c+b26YvlSQnVmARIuZrEVLS5iaLjLc1WeeatNgdDXN14MVVpG EuPK2blWTRzCg== Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 17 May 2024 11:26:33 +0300 Message-Id: Cc: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , , , , Subject: Re: [PATCH v8 18/22] tpm: add session encryption protection to tpm2_get_random() From: "Jarkko Sakkinen" To: "Ard Biesheuvel" , "James Bottomley" , "Linux Crypto Mailing List" , "Herbert Xu" X-Mailer: aerc 0.17.0 References: <20240429202811.13643-1-James.Bottomley@HansenPartnership.com> <20240429202811.13643-19-James.Bottomley@HansenPartnership.com> <119dc5ed-f159-41be-9dda-1a056f29888d@notapiano> <0f68c283ff4bbb89b8a019d47891f798c6fff287.camel@HansenPartnership.com> In-Reply-To: On Fri May 17, 2024 at 10:20 AM EEST, Ard Biesheuvel wrote: > On Fri, 17 May 2024 at 03:59, James Bottomley > wrote: > > > > On Thu, 2024-05-16 at 20:25 -0400, N=C3=ADcolas F. R. A. Prado wrote: > ... > > > KernelCI has identified a new warning and I tracked it down to this > > > commit. It > > > was observed on the following platforms: > > > * mt8183-kukui-jacuzzi-juniper-sku16 > > > * sc7180-trogdor-kingoftown > > > (but probably affects all platforms that have a tpm driver with async > > > probe) > > > > > > [ 2.175146] Call trace: > > > [ 2.177587] __request_module+0x188/0x1f4 > > > [ 2.181596] crypto_alg_mod_lookup+0x178/0x21c > > > [ 2.186042] crypto_alloc_tfm_node+0x58/0x114 > > > [ 2.190396] crypto_alloc_shash+0x24/0x30 > > > [ 2.194404] drbg_init_hash_kernel+0x28/0xdc > > > [ 2.198673] drbg_kcapi_seed+0x21c/0x420 > > > [ 2.202593] crypto_rng_reset+0x84/0xb4 > > > [ 2.206425] crypto_get_default_rng+0xa4/0xd8 > > > [ 2.210779] ecc_gen_privkey+0x58/0xd0 > > > [ 2.214526] ecdh_set_secret+0x90/0x198 > > > [ 2.218360] tpm_buf_append_salt+0x164/0x2dc > > > > This looks like a misconfiguration. The kernel is trying to load the > > ecdh module, but it should have been selected as built in by this in > > drivers/char/tpm/Kconfig: > > > > config TCG_TPM2_HMAC > > bool "Use HMAC and encrypted transactions on the TPM bus" > > default y > > select CRYPTO_ECDH > > select CRYPTO_LIB_AESCFB > > select CRYPTO_LIB_SHA256 > > > > The module request is not for ECDH itself but for the DRBG it attempts > to use to generate the secret. > > Given that CRYPTO_ECDH does not strictly require a DRBG in principle, > but does in this particular case, I think it makes sense to select > CRYPTO_DRBG here (or depend on it being builtin), rather than updating > the Kconfig rules for CRYPTO_ECDH itself. I can spin a new PR if James can make a fix. All previous 4 PR's for 6.10 were applied to Linus' tree so my queue is empty. Need to have both fixes and stable-tags to save my bandwidth. Maybe for transcript just two first lines denoting that it was __request_module() will do. That and adding CONFIG_DRBG will take it away should be enough for the full disclosure, right? BR, Jarkko