From nobody Wed Nov 27 00:39:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1703482235; cv=none; d=zohomail.com; s=zohoarc; b=SWbyWyEcb54yvnmv1iEHAbnPnIf4VmnI8q3S5gXyDNAsHPs3QwnIUSTbSKLo0UJxp3aCZvZwYIIPC+GzTSs8+58e0vsX3xVCe7NEHutImpr+dcBD0ZwG3x0v44iqIuYZD2vbYXHXQ8WacSooh6koubVuhnG0U1d0m2f7A+5GQHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703482235; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R3WxEzglk8uoFov+TGXHb/niKmhlgSt8io2ZCxKmYxI=; b=jfQUUNyqksvnvOCsZNFtMN3MgnrAUwdnplnB9uVoaNPFQZrIdVWVQ2I0ElJtMKnDlos7KqTgIDkAe2xOfoccbAKgp/PqZUXqhFNsPMX4wSO8/QQmz6+imOJLvkiVDXO/uiuzfH0Sgv54CZYtqKlGrZvpy+PW07yIg43ykLixGcU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1703482235467911.7080704044508; Sun, 24 Dec 2023 21:30:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHdWq-000515-Bz; Mon, 25 Dec 2023 00:29:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rHdWo-00050S-3v for qemu-devel@nongnu.org; Mon, 25 Dec 2023 00:29:26 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rHdWm-0007HU-NS for qemu-devel@nongnu.org; Mon, 25 Dec 2023 00:29:25 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3ba52d0f9feso2842025b6e.0 for ; Sun, 24 Dec 2023 21:27:24 -0800 (PST) Received: from localhost.localdomain ([118.114.58.28]) by smtp.gmail.com with ESMTPSA id f7-20020aa79d87000000b006d991505b4csm4555800pfq.76.2023.12.24.21.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 21:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1703482043; x=1704086843; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R3WxEzglk8uoFov+TGXHb/niKmhlgSt8io2ZCxKmYxI=; b=Bs7SehCnxRBeV2tRxh+Z5xMDTfEki0yR+qEG5KyDNm2NVYKFS0KZKVePFgYJRp87yb EEa8URHjXpW2WgcVKR1LVU0boie/TH5VsK4vqtLUJiQGjXQ1bt+qZp2HXP4XHT4N0vmi 3Hn3+RLPrkTIIiYBGVDvFQkkwPMxDG3sjpKUY6nKAnP8Vs83AKFZb6QJjaWPEhsC2VrQ kcIEa1FuxymUPaBhWI/TqjirPLD/jK5IyfAqxHoSWPOQqeZcMrwaLF0mkKUavhQgIQbW byZVr4MEd+nQ5P/0SFoZJ1lOLeYPkRHkCbwdnAy6P9YTCkaWzS2VgrQ3V7pGmXFpoAzX phcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703482043; x=1704086843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R3WxEzglk8uoFov+TGXHb/niKmhlgSt8io2ZCxKmYxI=; b=phoxsuxyDe8WMqijVY9AnnJTdKPTaFTFWGHRe+YN3Xxd9bF2q30WC5lWn/1kLpHQlz jSwlpzggie5IFEY+zUGJIkfCe68TkdNG7smCAONdvKwVWfp6jySJL89BdbWCAG8Zewn7 KPAoqPgUUlNe0LsUGdKZ7w9AKCj6Lg+hC/+T4yUGKU5WGj/5Y5+IHMvwcEBPvLhA44uF kTl0CxDpAxN8BCqtf01DVZvXWUW1BuUhIlCuM3Fa82nPD6Ica3G2nd+TbSoCb9ds7MWS ZfvhkPO1d+ULQbqEJ0yg+j74wEdECrz/mZ4wPgPEDYZU/99gAXX28QwkM/v3rdyj9YY0 Ua2g== X-Gm-Message-State: AOJu0Yz/mu5zs569GJw2kDqgWLGnORrwyoFi1z88FzxYSp7owaptuoB9 oiznzdIbcFn96OrI46fRKtAVRLFxEOhexYVDX1zlA0EGc4nGAg== X-Google-Smtp-Source: AGHT+IGObvQGA/FjvNuLDp8F9M+flWpqSWsYErTJcf2NXrBbZ10T2NGAFz6890VrWB6rMQ+iZ2opmQ== X-Received: by 2002:a05:6808:1493:b0:3bb:9636:1c04 with SMTP id e19-20020a056808149300b003bb96361c04mr4303647oiw.22.1703482042531; Sun, 24 Dec 2023 21:27:22 -0800 (PST) From: Hyman Huang To: qemu-devel Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Hanna Reitz , Eric Blake , Markus Armbruster , Hyman Huang Subject: [v3 01/10] crypto: Introduce option and structure for detached LUKS header Date: Mon, 25 Dec 2023 13:26:51 +0800 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::22b; envelope-from=yong.huang@smartx.com; helo=mail-oi1-x22b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @smartx-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1703482236821100001 Add the "header" option for the LUKS format. This field would be used to identify the blockdev's position where a detachable LUKS header is stored. In addition, introduce header field in struct BlockCrypto Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <5b99f60c7317092a563d7ca3fb4b414197015eb2.1701879996.git.yong.h= uang@smartx.com> --- block/crypto.c | 1 + qapi/block-core.json | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/block/crypto.c b/block/crypto.c index 921933a5e5..f82b13d32b 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -39,6 +39,7 @@ typedef struct BlockCrypto BlockCrypto; struct BlockCrypto { QCryptoBlock *block; bool updating_keys; + BdrvChild *header; /* Reference to the detached LUKS header */ }; =20 =20 diff --git a/qapi/block-core.json b/qapi/block-core.json index ca390c5700..10be08d08f 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3352,11 +3352,15 @@ # decryption key (since 2.6). Mandatory except when doing a # metadata-only probe of the image. # +# @header: optional reference to the location of a blockdev +# storing a detached LUKS header. (since 9.0) +# # Since: 2.9 ## { 'struct': 'BlockdevOptionsLUKS', 'base': 'BlockdevOptionsGenericFormat', - 'data': { '*key-secret': 'str' } } + 'data': { '*key-secret': 'str', + '*header': 'BlockdevRef'} } =20 ## # @BlockdevOptionsGenericCOWFormat: --=20 2.39.1