From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6610FC433E0 for ; Thu, 28 Jan 2021 17:36:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21E6064E17 for ; Thu, 28 Jan 2021 17:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233160AbhA1Rf7 (ORCPT ); Thu, 28 Jan 2021 12:35:59 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:41247 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233109AbhA1Re5 (ORCPT ); Thu, 28 Jan 2021 12:34:57 -0500 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1l5B9C-0006Sz-Uk; Thu, 28 Jan 2021 18:31:59 +0100 To: James Bottomley , Jarkko Sakkinen , Mimi Zohar , David Howells , keyrings@vger.kernel.org Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, kernel@pengutronix.de, jlu@pengutronix.de From: Ahmad Fatoum Subject: Migration to trusted keys: sealing user-provided key? Message-ID: <74830d4f-5a76-8ba8-aad0-0d79f7c01af9@pengutronix.de> Date: Thu, 28 Jan 2021 18:31:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I've been looking into how a migration to using trusted/encrypted keys would look like (particularly with dm-crypt). Currently, it seems the the only way is to re-encrypt the partitions because trusted/encrypted keys always generate their payloads from RNG. If instead there was a key command to initialize a new trusted/encrypted key with a user provided value, users could use whatever mechanism they used beforehand to get a plaintext key and use that to initialize a new trusted/encrypted key. From there on, the key will be like any other trusted/encrypted key and not be disclosed again to userspace. What are your thoughts on this? Would an API like keyctl add trusted dmcrypt-key 'set ' # user-supplied content be acceptable? Cheers, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |