From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 B9FF33E172E for ; Mon, 18 May 2026 08:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779091897; cv=none; b=F4MNG1kwZKvdI5/YGp09gyM3vZkq5q0HA96b5pBpxJvmFoK8bfTTYFbAZrH6MSluSahB0Z3LH/v3l8LCW99x2LEJN9dyYTkRw0YgRtDoO10Hv0klR76ShSsIoTRuqzmj0jEH01ubyZ4p3lhCWPNrXB2CIRpGUzkHjWRwF3REYAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779091897; c=relaxed/simple; bh=YBMaR7qngUs9wRDn0DCClR2eVoOnrE7CKmd3V8buKU8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ACeNpaBcu/HYy0ENg2WNiDvNsqrgag+ZwMA245f3wkltH++/gOoObVYqtV8oaiFY/pLMc43RKYoTCNE/FL2xqkoQf8En64aYX+D0zAz+MiJcVuqYvmm/LtE0cSW5b78mj5tE0R0CA9DBNsBosZQc+4R+PLa3FGOjtShULPh6rP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dIr8FOqE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BeKRFNi3; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dIr8FOqE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BeKRFNi3" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64I6iJvb723619 for ; Mon, 18 May 2026 08:11:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /LLHOHY/l/59SbiNQNsEV2KFEmIYyrDJ225fUGc83jM=; b=dIr8FOqEwL8sqd8w 29nFB/pbbQPZFztO32NV8w0ECOAgHb9YOLPE0Zhibk5ZBKSO87bSVgw1bj3KY3ET eZGynqAQoy5dSvGDSJa2H4kyTYVSl+fTDFjhORrn2IhIMFmnfFGFMDnzguiUL1cO 4v9Q2kTbkdwWEQbhiBaEJshaRE5f5kyyOy5776sbiQUnLgejgIDcY2s1Il4j4iD8 BueyDR9LmImD0IuF/QxB1MdtOAvg5mW6I2S7Ic+8qceE1vbE046KZSCQ/cClieO6 iSXUBqroG4B+Armc0g9EG6WUTEINQ+RuzjH1ywkPrIR5vyDH5HhGdi1VrfYuvUhf EbnawA== Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e6h0qddw8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 18 May 2026 08:11:34 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2eebb099efbso6535127eec.0 for ; Mon, 18 May 2026 01:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779091894; x=1779696694; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/LLHOHY/l/59SbiNQNsEV2KFEmIYyrDJ225fUGc83jM=; b=BeKRFNi39g1+PNMK3g4oyXxoW8OsfuLs9PG9EAT1GOoAO8t3qo4waaNdinyP20vWsE gW4sQrjpkwE2Hvtt0tGJxJ8SsurA7q/lGLK1EA6KIpkV/saWx2kj909AM9azSGM0vbCQ MiP8T8YSJby+Xxq9h4m5LoiDH9lm0gpnBPHVk+xY6YhZs9Dq2Yq5yyn6veF5ZDPlIn1O ep77qc35sE5jnUDar9Cfw08hZ4zyIaqv601SMcWWF/eiZc6YVfI7yH6P+j2dNbtnXXw3 OXkSAMGPHMleef+R7T88KeBUZemFoSnoKcG+Gkb/uT+6F73NzMy4reUqam2SYxLmERo4 AobQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779091894; x=1779696694; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/LLHOHY/l/59SbiNQNsEV2KFEmIYyrDJ225fUGc83jM=; b=Y+/6F3SzdyN56GcHZ1iE8q1J3GFHWRT1QbPRJRCdJb9LScCWjS8DK1SMEyqk3Lj9dp bZ/UHAP9cdoJAfn8XGHpXbiy11nzmdRU4GWmTCsfQjKSFOspbjmoeQuXV9Hpw9AinrSZ 0GN6WRQYCNqt1tlU5QnFz9bvqDa0+Ft0PUIMjrXvx9Gymf25pv7gCBFy7GyWQ95Ctxoz zek10ob0Ebe0QhTTI21fE9ngAWTemzBbxcqgx3078PrDF/p8PJf5wGxXOV5R/kQ5Zv4X Nyd1Zua5iTBkB7a0weJwCqOZ9u5RthtLhYQHOpzfunlJCSevrtDZDSXEG0fXD4BQIbq3 8pHg== X-Forwarded-Encrypted: i=1; AFNElJ8zHrKxHJYxcgdwwhepItoH3oihR/MNUcT5INdXZhUGwrItq+dkqiI5nZD4AHJzfSGShVQ+VjaiSx205fg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3VScEU8ZtArWzjTIzI6/7mX31w2GM1IXokuoT1a159+N+QHu3 eC7nEARYVBH0tJtpOOY9l5PKLb7LiUN7UIWAHxAfyXvVGqMpsp+5oqJO65nCEemzDIbW3Ihhxr6 W7VHeWFDz6NGiKA4Ifh1JbJVn67OA7Mycy7rNJw3PjqiB+rdkooMMVWYUF78oHHUuHZQ= X-Gm-Gg: Acq92OGLxI/8WY986YRvw+kdktAz5juHntKVl64ehm1/ByHElPE5yk7/3uYj3B6FWGT 62P+wY30WEkyhUVJM6hmofMAheVgwUdGReYx1i2yhd7D+UfZ9Dg/ATfPH51t9ZjVCd3H6gLd76i t4ieIG65e0WHQ0M2rDcKNZ6lbFzdefUqFI9uw/cQxyYZr8RjgV9pAjovNm6pJq1cRIZz9mhhjiY zBY6NAULRL717GAU6BmCsbR6dLNTlqAXi/6WSAqZx24RYwEa5cS8tB6HWooqlUbQsb6mhJVTS8g UldEDjsEIqO1vtQALfHq4GshM/d1li8cf0qYoZ7ZDdTMVshLXUssCBaslAXL0uiZQ4wvjy3N5ZC NKGGIoknWSCNSS/uZVg+ST+ISoiIliSaRpiEMTPYiDXZR9snjNKDj/vzeDVT6OY19eLWUFbhZs6 FFKp7e+nH0AbCtpw== X-Received: by 2002:a05:7301:3d12:b0:2ea:5057:a304 with SMTP id 5a478bee46e88-3039818a65bmr6141242eec.2.1779091893620; Mon, 18 May 2026 01:11:33 -0700 (PDT) X-Received: by 2002:a05:7301:3d12:b0:2ea:5057:a304 with SMTP id 5a478bee46e88-3039818a65bmr6141233eec.2.1779091893125; Mon, 18 May 2026 01:11:33 -0700 (PDT) Received: from [10.110.122.43] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-302973bbd50sm13061203eec.20.2026.05.18.01.11.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2026 01:11:32 -0700 (PDT) Message-ID: <2712f864-0f68-4428-9ba5-55fbf35de6e8@oss.qualcomm.com> Date: Mon, 18 May 2026 16:11:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] dm-inlinecrypt: add support for hardware-wrapped keys To: Milan Broz , Mikulas Patocka , Eric Biggers Cc: Alasdair Kergon , Mike Snitzer , Benjamin Marzinski , Neeraj Soni , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org References: <20260516115045.3958326-1-linlin.zhang@oss.qualcomm.com> <20260516115045.3958326-2-linlin.zhang@oss.qualcomm.com> <3b57685a-09b4-473a-8810-bbb46769ab42@gmail.com> Content-Language: en-US From: Linlin Zhang In-Reply-To: <3b57685a-09b4-473a-8810-bbb46769ab42@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: AL5XTcwW3WeBLMTuUsDTZWLFxrMhnu94 X-Proofpoint-GUID: AL5XTcwW3WeBLMTuUsDTZWLFxrMhnu94 X-Authority-Analysis: v=2.4 cv=fIMJG5ae c=1 sm=1 tr=0 ts=6a0ac9b6 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=VwQbUJbxAAAA:8 a=p0WdMEafAAAA:8 a=EUspDBNiAAAA:8 a=ne3KJlC3Am1FYSLfDcIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE4MDA3OCBTYWx0ZWRfX3fOpWEktORar QxVPPL4tVWYpNpWKts5PV59KZnhbUqibj51qWubP9hqzdFiW48qMRQF0p2LqEo3yb7mj+jC4BWd tK1nIOQtIQ8LIRO4y8axCv5lz/kJesXKc77mbdgTqJOsNPLbzWn5B7SVjj5kra8zcPkMq86Z5Wu 3mDuhq1dwtoBSyuMDHMzXLETI3i+ADZ1kqRY9d2aL9EMff+Bzwbt9cs0ZjZpTZcGfriZ+TCUugJ 0pg1K/diYk19ZeFI7nzZm0QJ/ZJlzwQSNQweAmTZU2kNpNG/bM0gW6zoaFcGkrDdD3BYVqGt6nr ZQ67X+dvxuYr7t9tNFVSA+DEAyg5kbwu1gdBWslChOKaFqP6vNOJbUoO+5cOVV2S/GtwTnJfF+9 aL+Rb0d5KodPkxtccVd9WAJusfyzwYMhp1cUPP3Z662dqvgDrBr3znBqyBqaPtN2y/CTsWq6A1k IBdWu6E5VWEK2A5fz9g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-18_02,2026-05-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 spamscore=0 bulkscore=0 phishscore=0 priorityscore=1501 adultscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605180078 On 5/16/2026 8:17 PM, Milan Broz wrote: > On 5/16/26 1:50 PM, Linlin Zhang wrote: >> Add support for hardware-wrapped encryption keys to the >> dm-inlinecrypt target. >> >> Introduce a new parameter to indicate whether >> the provided key is a raw key or a hardware-wrapped key. Based >> on this flag, the appropriate blk-crypto key type is selected >> when initializing the key. >> >> This allows dm-inlinecrypt to work with hardware that requires >> keys to be wrapped and managed by the underlying inline >> encryption engine. >> >> Update the target argument parsing accordingly and pass the >> key type to blk_crypto_init_key(). Documentation is also >> updated to reflect the new parameter and usage. >> >> Signed-off-by: Linlin Zhang >> --- >>   .../device-mapper/dm-inlinecrypt.rst          | 10 ++- >>   drivers/md/dm-inlinecrypt.c                   | 71 +++++++++++-------- >>   2 files changed, 50 insertions(+), 31 deletions(-) >> >> diff --git a/Documentation/admin-guide/device-mapper/dm-inlinecrypt.rst b/Documentation/admin-guide/device-mapper/dm-inlinecrypt.rst >> index c71e600efb76..3a4ce2c5f228 100644 >> --- a/Documentation/admin-guide/device-mapper/dm-inlinecrypt.rst >> +++ b/Documentation/admin-guide/device-mapper/dm-inlinecrypt.rst >> @@ -10,7 +10,7 @@ https://docs.kernel.org/block/inline-encryption.html >>     Parameters:: >>   -          \ >> +          \ >>             [<#opt_params> ] > > Please use optional parameter. > Adding mandatory field will introduce unnecessary incompatibility with dm-crypt mappings. > (The idea was that you can simply switch "crypt" to "inlinecrypt" for raw keys.) > > I would probably just add "hw-wrapped" or "keytype=raw|hw-wrapped" optional argument > (with raw as default, so no need so specify it). > > IOW the mapping will look like this (1 is number of optional parameters): > >    1 hw-wrapped > or >    1 keytype=hw-wrapped Thanks for your suggestion! I agree that keeping "hw-wrapped" or "keytype=raw|hw-wrapped" as an optional argument helps preserve compatibility when switching from "crypt" to "inlinecrypt" My concern is that, in practice, this optional argument may effectively become mandatory for certain configurations. For instance, "hw-wrapped" or "keytype=raw|hw-wrapped" must be set for a wrapped key. This slightly blurs the original intent of "optional arguments", which are typically expected to be truly optional for correct operation. Would this be acceptable? which one is more acceptable for upstream? incompatibility semantics mappings b/w dm-crypt and dm-inlinecrypt or blur the original intent of "optional arguments"? Any additional thoughts or feedback from others would be much appreciated. Thanks! > > The second option will allow to add new key type much easier. Regarding the second option ("keytype=..."), I agree it is more extensible. Could you please clarify what other key types you envision supporting in the future? > > Please check how other targets implement it, some dm-crypt examples > https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMCrypt > > Thanks, > Milan >