From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 879A03FB079 for ; Wed, 13 May 2026 11:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778670381; cv=none; b=AmjCDrrXpK0Xq8nWckYWsKE0iUo0rdnEMR0yIUg+GvmnXLG58TmnkupOhkcACjy2PsqMI2AVFbJhXgYsvzq7dvEUdPbCU6LxS+D8C/CTUrbeyBE2T4ofZwkPr58mXMaYyyb/wk1rtZqvLjmNNj0fIxuKeUTA1UhezhouKWsot40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778670381; c=relaxed/simple; bh=oRBfEG6V06ZPBsNalKp3fPrBA64JATwU3SY33qQ8O+U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O3fBnuUjUhZOAPl8cow7224bn6t+zTBuQEBaM0ebhKHbaz1ibhXPW2GnNwuT5x4TlzKdRgDdLgToHjxjpWJmg95OdXAM3JR5y+y3h4GYCkvjvhB9PA0LQxXUIjfVDPIzZD3RVKtYnsMlIOVQ+7NSbVoOaH6XGWmFScYHxB1uXSI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FV2hILb7; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=cULJYiJG; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FV2hILb7"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="cULJYiJG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778670375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=g4aX+tA7681RtoZuYuTTDvdoIPi9sMbmQGgALbo6OmY=; b=FV2hILb7zrHLXGBAoVhoNRoN/xdsZv/3xlPREhNxWsEeiMzC+e55dI7noBlWuWej99qKBk qVM00vL3DS0lypAmHfBe+4FufX9rMJQm/wvRb74Fp4UliG0PuAMpppeP8YNb+JFBNVZMGz YfpH37HqXRGnZHz2tlNo908DnUCcncA= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-505-VEZ4gLliNc2XsIRPf3j88A-1; Wed, 13 May 2026 07:06:13 -0400 X-MC-Unique: VEZ4gLliNc2XsIRPf3j88A-1 X-Mimecast-MFC-AGG-ID: VEZ4gLliNc2XsIRPf3j88A_1778670372 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-83eefe4867eso1109331b3a.1 for ; Wed, 13 May 2026 04:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778670372; x=1779275172; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=g4aX+tA7681RtoZuYuTTDvdoIPi9sMbmQGgALbo6OmY=; b=cULJYiJG3L1Sya/l2VnRMl7xXQztumF+fT0uXPI8Ib7Nfn/AL1k4PyrXD3Yh+Jn97z h649pU4aFMKxU6P3921XcMdwpGq7UqYPeZnyJPAEFUkGXN6VZhIF3zVKR/63TUjes/4R 58mMQPDJH1BOz+X0oc6hg4GRSekeGSU4l7gT1dJqMugQnyuGarLqn7nTKEETPPrMgdMo 9UpkqcGP0oZimkRDJaCgH1LfPj7DA7S2mMLVCWsVZTkg0SFPxRFK4ALc3dbgmUsh4bJB 1Myendy/Yu+sH+Fw/Y+UUCqdB+MnKPx/7tzX6mNy2UrhTaixp4CPBzCuREJJLPsM+YWo X9EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778670372; x=1779275172; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g4aX+tA7681RtoZuYuTTDvdoIPi9sMbmQGgALbo6OmY=; b=K0i1m2zurhYgfD3qNFkTkRSISrMARLK1+WYKMNcYrLtJ4NTf3tL86b9GayLTvzDcoE 6NgZ9M4aOBN5J6WqL5epWpjqWHP04/GLRpY8M4pdR/3BHXHBPY06RjyvvDCoIAMw2G8r j8niAytOuT1NPIK1ORfJYOIKeooTTEwgJYu0TE7aZaYe8+C4st7FiB9AjNmvyGY6C0fO FBECo4IrYDtosMjrOcpXRxS4ZTpAkzXBVdZ8wVTupZJGH1UIN/iABvN1CjdQ0IGjIpdv rThHnPYKRbkGtPlBC92Iw3knQJCxSXuvXZICsduZf5Cudz2l8kv2W5gokgSCLUc7yBWK Wqsw== X-Gm-Message-State: AOJu0Yy0NIIWZjkH0fIHYmM6y7oNqGNAaCasLgIknWiuuCVhmwDJ/Ws3 vkNebFtt5xNz944C7nYw7Oemeavwzbe1BpaU0jty7OzyMNa28dLMyPzI8Tz6QMmCvA4H+bnKDKv R7EhpxT24PDN5Pvlr6aPXvbI07D8DyuTKKcDHj+lwJJdV0TyyDvp+O8bIMLnzgRHgeg== X-Gm-Gg: Acq92OGNgg2FzliFMqydINhcqpRyVaUqSPTM0gqcBTQlRU4/kK6h9nzJTKZyK17GC65 YlQtZ3jdmYWYXV73kiDjmdVSE/UwVZDls6E7BDXRlKKROUluEJSjP3BIJ+P0yxY5nm8fXJub/Be rIG7gax844EO02qVg9wSZxeANhUzow7hOypUMgefADgd7vGCrUObI3KR5keW9XGZvcNaqDCUy4F K0En9+EtnrffHELtJgwmYmcjc1X23tygya+ffflS0NEvMjM7kZFzT48PSX2U0PvAsNYZKTjSfSA ncOwbKj8kqbwbQBCMPEnJGvwbMJJ8UKdjpp7R41j5naZR+Dmi8GtqwgSI3P+3ONYB3lsxjDF0+u Q0Y9y4uoQw/7L X-Received: by 2002:a05:6a00:14c3:b0:838:af72:fb35 with SMTP id d2e1a72fcca58-83f03e949f1mr3022954b3a.10.1778670372141; Wed, 13 May 2026 04:06:12 -0700 (PDT) X-Received: by 2002:a05:6a00:14c3:b0:838:af72:fb35 with SMTP id d2e1a72fcca58-83f03e949f1mr3022912b3a.10.1778670371677; Wed, 13 May 2026 04:06:11 -0700 (PDT) Received: from fedora ([49.36.106.210]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-839682a20ebsm27211301b3a.53.2026.05.13.04.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 04:06:11 -0700 (PDT) Date: Wed, 13 May 2026 16:36:05 +0530 From: Arun Menon To: Jarkko Sakkinen Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, Peter Huewe , Jason Gunthorpe Subject: Re: [RFC v2 4/5] tpm: Increase TPM_BUFSIZE to 8kB for chunking support Message-ID: References: <20260324181244.17741-1-armenon@redhat.com> <20260324181244.17741-5-armenon@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, May 09, 2026 at 06:07:11PM +0300, Jarkko Sakkinen wrote: > On Sat, May 09, 2026 at 05:54:25PM +0300, Jarkko Sakkinen wrote: > > On Tue, Mar 24, 2026 at 11:42:43PM +0530, Arun Menon wrote: > > > The size of the command is checked against TPM_BUFSIZE early on before > > > even sending it to the backend. We therefore need to increase the > > > TPM_BUFSIZE to allow support for larger commands. > > > > > > For now, 8KB seems sufficient for ML-KEM and ML-DSA algorithms and it is > > > also order-1 safe. > > > > > > Signed-off-by: Arun Menon > > > --- > > > drivers/char/tpm/tpm.h | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h > > > index 87d68ddf270a7..26c3765fbd732 100644 > > > --- a/drivers/char/tpm/tpm.h > > > +++ b/drivers/char/tpm/tpm.h > > > @@ -33,7 +33,7 @@ > > > #endif > > > > > > #define TPM_MINOR 224 /* officially assigned */ > > > -#define TPM_BUFSIZE 4096 > > > +#define TPM_BUFSIZE 8192 > > > #define TPM_NUM_DEVICES 65536 > > > #define TPM_RETRY 50 > > > > > > -- > > > 2.53.0 > > > > > > > Shouldn't this prepend previous patch? > > Also did you remark that tpm_buf would also need changes as it is fixed > to PAGE_SIZE? TPM_BUFSIZE can be increased, in its new location include/linux/tpm.h as per the patch : https://lore.kernel.org/linux-integrity/20260125192526.782202-12-jarkko@kernel.org/ and I think that alone will take care of the check if (size > TPM_BUFSIZE) in tpm_common_write() in drivers/char/tpm/tpm-dev-common.c. However I was not able to apply the mbox file cleanly on the existing branches for-next-tpm and for-next-keys. I could apply them cleanly on the old branch (next). Please guide. I would only change the TPM_BUFSIZE set in [PATCH v9 11/11] tpm-buf: Implement managed allocations to 8192. > > I've made a patch that essentially makes tpm_buf size variable as caller > does kzalloc: > > https://lore.kernel.org/linux-integrity/20260125192526.782202-12-jarkko@kernel.org/ > > I'd see this as pretty good long-term solution. Indeed. > > BR, Jarkko > Regards, Arun Menon