From nobody Sat Feb 7 11:31:31 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 D8C1C2D248B; Fri, 23 Jan 2026 16:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769187333; cv=none; b=s6Vx0TRRonDOGvPl9p2RENNpvPMRpWYz3qL0dRJlmG8C678FR7N9X8z1DEfIHu5oQlGVoTiTqNxerR9A9Rm6d/aMj1/IwCQOe16ACHGZmgaTQvB0K6tgS+7ab4jVubgiGJEUy9R1H9VPVV2wZB4tS6Ta18QHmP6dORDzjp9E9xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769187333; c=relaxed/simple; bh=2UbMowoHB+eebDClvXgnHzPRlVQAY4/5F2+aLO7vgFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P12brRbb9iCmgN8jQcx59dIPrgALE1RFvIzz0WCfDYA3i+HNjo8NoEjPK4iYOKl9HfSdRhj0snFgvDnMU7hHwKVwtmf3Ks6gFpmKu9gIKn44zrp3kXIjLoGlptLVJOfX4BMFe8xBCugJcW2FjINEkE/bSzYMtYencCqws9LDq2w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=k7fcMRav; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="k7fcMRav" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60NCHVLX006245; Fri, 23 Jan 2026 16:55:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=sSSObmaBHzSZGv4ot VJv66VVl55JRC8Pf8MrfzKU3xM=; b=k7fcMRavhE5QgpXpAV6bquaPoTBVfVyBU d2RRvQVRVJ7FiNPxUxHuptbI9QeKgCN/gZfOc5tm5vxMLUDz7hmjLFrWK1RXZYWg 3qEj8o4nlAAsnpZ4l+o7yxpi+3XJ7DkL+3E//nvNDv5FOUDA84M5JXRCLE+X115Q SLzFpaPZnkAiUUVCq1R/ZHy9+9cAA56odq3bhSz/P9lPxUOS6GtKXm+u15uwBo2W 7Ceo3e4zbQ9zXWJuF1XT2jBXmAbJmIJ2vYapimXVibqvFP6+xfr+vC+m3Xo3Zc1v GOVwUEoTKFI++I30Y8FJiAJ0nmTlt46tqkY8NMtEcL8v6ExZJnrDA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4br23sh9sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jan 2026 16:55:18 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60NGtIJx014779; Fri, 23 Jan 2026 16:55:18 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4br23sh9sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jan 2026 16:55:18 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60NGWJuR024575; Fri, 23 Jan 2026 16:55:17 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4brxas8ga8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jan 2026 16:55:17 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60NGtCfR51053008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Jan 2026 16:55:13 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C907C20043; Fri, 23 Jan 2026 16:55:12 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17E2A20040; Fri, 23 Jan 2026 16:55:09 +0000 (GMT) Received: from li-fc74f8cc-3279-11b2-a85c-ef5828687581.ibm.com.com (unknown [9.39.24.251]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 23 Jan 2026 16:55:08 +0000 (GMT) From: Srish Srinivasan To: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, James.Bottomley@HansenPartnership.com, jarkko@kernel.org, zohar@linux.ibm.com, nayna@linux.ibm.com, stefanb@linux.ibm.com, rnsastry@linux.ibm.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, ssrish@linux.ibm.com Subject: [PATCH 1/2] keys/trusted_keys: fix handle passed to tpm_buf_append_name during unseal Date: Fri, 23 Jan 2026 22:25:03 +0530 Message-ID: <20260123165504.461607-2-ssrish@linux.ibm.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260123165504.461607-1-ssrish@linux.ibm.com> References: <20260123165504.461607-1-ssrish@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: MoLwE31rfx7i8-GuLQPgs9pBEn8jRUew X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIzMDEyNiBTYWx0ZWRfXwJqjHt/+m8MH 3Wg51FmYSC2KbpxjvF8wORafer6kypv8d6POsKb+e5R6+kSv8QWuDiWnm8G/C2ck3+SL9qC5UgC popO/dt70otSTXTXlStK+QSEo/oDVSJaBkjLVUJNQWSdUOXXTkpJJBHzcjFykS5Kp3+Ddq33e5x NZUIVWBaaUSy5Bzt+70K60eTqSIBh5OT7+YFQxfT/Wn8j2kvMBpat5qYnezOfUnxW1+N7tD0+Hg 1tpIinqeCEhUzharpHUj3fmr4ZrX9+gyXpdMzCzYnQ0yiGkaoBdvFVvFYexwyZajXXbCVyT7XRD vCe03e/YWC0T+1z2MRH8/IanpZ10cE3GspXBWxQmDJuJHtn1AWxxuXISLEKrsumAMXl9PyT/6K4 owMJzrc+eDSPL4n04JruPwmK5BTmdK3ZH+eAXRtWs2oqB1NamegdIRTBYtMU6cgI1Av3T81OR6X K9Cv/zkdO7jFN26PEgw== X-Authority-Analysis: v=2.4 cv=J9SnLQnS c=1 sm=1 tr=0 ts=6973a7f6 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=xt6ew7UTAAAA:8 a=VnNF1IyMAAAA:8 a=EpWLErYAll7kcGvWJ9YA:9 a=tn93DeGZTgJ6DdWMtdD4:22 X-Proofpoint-ORIG-GUID: tOxMknpbSxKblg1LmuFLTb5WundC0547 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-23_02,2026-01-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601230126 Content-Type: text/plain; charset="utf-8" TPM2_Unseal[1] expects the handle of a loaded data object, and not the handle of the parent key. But the tpm2_unseal_cmd provides the parent keyhandle instead of blob_handle for the session HMAC calculation. This causes unseal to fail. Fix this by passing blob_handle to tpm_buf_append_name(). Fixes: 6e9722e9a7bf ("tpm2-sessions: Fix out of range indexing in name_size= ") References: [1] trustedcomputinggroup.org/wp-content/uploads/ Trusted-Platform-Module-2.0-Library-Part-3-Version-184_pub.pdf Signed-off-by: Srish Srinivasan Reviewed-by: Stefan Berger Reviewed-by: Jarkko Sakkinen --- security/keys/trusted-keys/trusted_tpm2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trus= ted-keys/trusted_tpm2.c index a7ea4a1c3bed..6340823f8b53 100644 --- a/security/keys/trusted-keys/trusted_tpm2.c +++ b/security/keys/trusted-keys/trusted_tpm2.c @@ -465,7 +465,7 @@ static int tpm2_load_cmd(struct tpm_chip *chip, } =20 /** - * tpm2_unseal_cmd() - execute a TPM2_Unload command + * tpm2_unseal_cmd() - execute a TPM2_Unseal command * * @chip: TPM chip to use * @payload: the key data in clear and encrypted form @@ -498,7 +498,7 @@ static int tpm2_unseal_cmd(struct tpm_chip *chip, return rc; } =20 - rc =3D tpm_buf_append_name(chip, &buf, options->keyhandle, NULL); + rc =3D tpm_buf_append_name(chip, &buf, blob_handle, NULL); if (rc) goto out; =20 --=20 2.43.0