Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3360427lqo; Tue, 21 May 2024 14:59:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXvxtlkx5OqDPPGgwBPySad0CRtt/f3akIyM5YH8KhcBqBFkVwCrsJVx8i1m/SvwiwrLiKVf3qq3QlMOwF9zJULVzlMOGgHztWlmdw/Q== X-Google-Smtp-Source: AGHT+IGv8x9OWhXVKtg46YTKLxJcPRMtozfTumJilgAH7C5R9Kqjs8rxsHJM1ZHoUNwVwitKJ6nY X-Received: by 2002:a05:6a20:5a89:b0:1b0:260e:fe71 with SMTP id adf61e73a8af0-1b1f8a79392mr276501637.60.1716328774713; Tue, 21 May 2024 14:59:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716328774; cv=pass; d=google.com; s=arc-20160816; b=VWZHzJB57iznUONARDUm2qf2yoW9DhEz+v3MCj8VUt6WuDdchyACn0VIlxw7padVeR VMkQAIfHN4zeKtA58Xhvvm5G9CXQ2qOP6UcmZqMTwLUCbzVUVgcnQdMSy+iBaj5+EQT+ lpiyLRhKPWchT9hDdL5z43lvhUtoM4gAShOigRBuOA6GdCsDwJDB0JVgW++ScvWevqLP hQXUgqLZoIA3r+loNVw7jzell8vMsN9MkR7A7FyI5qcAbMlgrzptX3WSuiDJH/d7z7xp weMmoLZBP0c7zTVCVCbU5WjkBtk4p33CqglY3YF4dwbiUK5orDnN+r+4K7HtMdtDjXQH mfDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id:dkim-signature:dkim-signature; bh=XG7tIm3IGPmQoNprkqmjUZ8NfH2qHQtbHpnxi43D2N8=; fh=jc3gJ1Y+1cNuKuCgEQV0bcU9BtrjMZQ/D5jGWoOZds8=; b=qMk4gU3gq1rxqGfrJxbpklt8zWNawpKwzVZm8iTjeZHzXspvRYW5OzjEVCtnFcwyKw +skYXy5vE+Xrt32RKjFsuB+Z5T//4ROWnDo9MUDPjU7AbrV1G+KvoM+inv5c/HnuuVzO FgIlAP0xrPuaFc81ZYOw5Bz3yE3ndK4wWDx1/lw5aE3tgjCOByRK2wutg2IxP3Xfy7DA UNRXfqfYfQVU6qWzDbdCF9g1kwtyK79FCKhTdxCwOupfgt5zt9a5HbQsqF6JILZgrOE6 WU8CyheSGYCPKWV7gJEIjq+R5g7+YZfvBvt80HWqSlBFEgLHPRINFoa/jtQYwUMKzQCh EmYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=GGY3zSRZ; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=GGY3zSRZ; arc=pass (i=1 spf=pass spfdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dmarc=pass fromdomain=hansenpartnership.com); spf=pass (google.com: domain of linux-crypto+bounces-4315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4315-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e8169dsi2107938a12.170.2024.05.21.14.59.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 14:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=GGY3zSRZ; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=GGY3zSRZ; arc=pass (i=1 spf=pass spfdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dkim=pass dkdomain=hansenpartnership.com dmarc=pass fromdomain=hansenpartnership.com); spf=pass (google.com: domain of linux-crypto+bounces-4315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4315-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com 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 3BDD1B215A7 for ; Tue, 21 May 2024 21:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55D56149C70; Tue, 21 May 2024 21:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="GGY3zSRZ"; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="GGY3zSRZ" X-Original-To: linux-crypto@vger.kernel.org Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [96.44.175.130]) (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 6D392487B0; Tue, 21 May 2024 21:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.44.175.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716328764; cv=none; b=KDxOxDwjVWKW9TpkhJ+8SSPYuObyaIJ+nf0LpMOUb5QJqhRf7gu7sVJlS/ifoTbc5uftk77UBo2G/wDMpYHF+zNIyvMOzjDSSks1GnYtPb5Wd5CoOr5A5PyRxFS98UUDF6mvl4alGtZlvI6dHCcB5nQskjVwpQL9i0NrCRK7HBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716328764; c=relaxed/simple; bh=ExRaYfsiZeEOmvmtCvC4K/IJ1+lTsHOUpjawdxFpOgA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=EyrclqEFaa9FHy3pk9DtrYsHEsDwkzWrNynrlzKaCTAGuNQ2AKI31yKC6Nzr6QmrkkCva7PTZ0HhtlwD3xThr1i4r5EraomhOxLE9QP/0uF4WLNNEdXznihD0rDebgYWH/GdiCRU9A620hMHe7Syph0fIqEKqdVPsrnx2xIIxl4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=HansenPartnership.com; spf=pass smtp.mailfrom=HansenPartnership.com; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b=GGY3zSRZ; dkim=pass (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b=GGY3zSRZ; arc=none smtp.client-ip=96.44.175.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=HansenPartnership.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=HansenPartnership.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1716328761; bh=ExRaYfsiZeEOmvmtCvC4K/IJ1+lTsHOUpjawdxFpOgA=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=GGY3zSRZBXRAVTF0VPyPtMh0JOhRXt0t/96tI+v3rBLKPPakAXq2XfLmnRItO59p0 MWW+fTE2TaKFjwLTa1yNwcRuShBGKnFWEu+trlwZeNjenZ4WEP6wTyDmJTYIT9k4uy Ka81hxz3oMEOG7upCvQKNuUQVLat+Or+bwLQmJvI= Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 8ADAD1286FF7; Tue, 21 May 2024 17:59:21 -0400 (EDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavis, port 10024) with ESMTP id wXRn9UmN3dKw; Tue, 21 May 2024 17:59:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1716328761; bh=ExRaYfsiZeEOmvmtCvC4K/IJ1+lTsHOUpjawdxFpOgA=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=GGY3zSRZBXRAVTF0VPyPtMh0JOhRXt0t/96tI+v3rBLKPPakAXq2XfLmnRItO59p0 MWW+fTE2TaKFjwLTa1yNwcRuShBGKnFWEu+trlwZeNjenZ4WEP6wTyDmJTYIT9k4uy Ka81hxz3oMEOG7upCvQKNuUQVLat+Or+bwLQmJvI= Received: from lingrow.int.hansenpartnership.com (unknown [IPv6:2601:5c4:4302:c21::a774]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id DF2F31286DFB; Tue, 21 May 2024 17:59:19 -0400 (EDT) Message-ID: <239a52eb5ed3a6c891382b63d08fe7b264850d38.camel@HansenPartnership.com> Subject: Re: [PATCH v2 4/6] KEYS: trusted: Move tpm2_key_decode() to the TPM driver From: James Bottomley To: David Howells , Jarkko Sakkinen Cc: Herbert Xu , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, Andreas.Fuchs@infineon.com, James Prestwood , David Woodhouse , Eric Biggers , "David S. Miller" , "open list:CRYPTO API" , open list , Peter Huewe , Jason Gunthorpe , Mimi Zohar , Paul Moore , James Morris , "Serge E. Hallyn" , "open list:SECURITY SUBSYSTEM" Date: Tue, 21 May 2024 17:59:18 -0400 In-Reply-To: <336755.1716327854@warthog.procyon.org.uk> References: <20240521031645.17008-1-jarkko@kernel.org> <20240521031645.17008-5-jarkko@kernel.org> <336755.1716327854@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit On Tue, 2024-05-21 at 22:44 +0100, David Howells wrote: > Jarkko Sakkinen wrote: > > > On Tue May 21, 2024 at 9:18 PM EEST, James Bottomley wrote: > > ... > > You don't save a single byte of memory with any constant that > > dictates the size requirements for multiple modules in two disjoint > > subsystems. > > I think James is just suggesting you replace your limit argument with > a constant not that you always allocate that amount of memory. Exactly. All we use it for is the -E2BIG check to ensure user space isn't allowed to run away with loads of kernel memory. > What the limit should be, OTOH, is up for discussion, but PAGE_SIZE > seems not unreasonable. A page is fine currently (MAX_BLOB_SIZE is 512). However, it may be too small for some of the complex policies when they're introduced. I'm not bothered about what it currently is, I just want it to be able to be increased easily when the time comes. James