Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5497827pxb; Mon, 7 Feb 2022 03:29:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKbG35KQpD5OO4ahYBMnA0XAhi36yvEFUgq5caG76lO8LAiO8yOiDdpXR/mOmLBMlKVslw X-Received: by 2002:a17:907:1c8a:: with SMTP id nb10mr9686697ejc.273.1644233344563; Mon, 07 Feb 2022 03:29:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644233344; cv=none; d=google.com; s=arc-20160816; b=fvUjCJ4YbvFPHT9fM3tg9WkA3uzQ0kp6g0OZIy4AqHrMBv9oV+FKrxAFdCXfDTJkka 2jjNtzU6VaD/fnl6h6BF+3uAxZ2/VqR2fusVh3ML1CtyGLoK20DxeLl9U29iuSWnLkWb oyVGuJABTQCixgKnBalnCBEhQShpomyFIBj/YMal3pgQ8ngd4iWChx7Fjlz/4hXI4rIN 79Yc+d9XrOwFKeUq3Bbx6sOb1alxn5cc8OH13jeJkI82cqouagBYoJfAzzKZ1aeJq7AM 6wJZHqJqyyvNIdFqNPjrdr8wWsOrK5Sq1SMxtZ3xtkgsYNv07vJbEWaIFF5RN5nUsWE1 R7Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q1SinzAKwpiCqfX1Zl6/gMx0rR5FUCcTZVzRrlDjS5c=; b=vbO9vxybACeNUCbyHo2ugxtaFYfbxkCVdxewA5fBFr0awORdnGacWJM/s9YAArv4bL tAhjWYFXKsZIk0yenowKvz+rlFawX8V3NaJ+g0Wvq1XY6kP5DT2G7d40s+FXi6yKza4n EqDlME/ULB4aEJ/H5X4uGAU3prSmaUuCNxXweqkwwA8U012pKyKC3Z8bHW9nv629pWNt K68Yw0c1v7yNOJKBOJvNYke5ha4emIzvNZl+Jiqd17TcFJVID/KC3QfoxC6Ywrx9y8Sj wMzJTxxxk1Mw6y15WDE3L70MD12fDBSSw9JN23JAzqMqluiC2lhRJ0mNWXjtAHitKF9m /Eew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b9ngHE68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr18si7768036ejc.858.2022.02.07.03.28.17; Mon, 07 Feb 2022 03:29:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b9ngHE68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243773AbiBDG2b (ORCPT + 99 others); Fri, 4 Feb 2022 01:28:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234257AbiBDG2a (ORCPT ); Fri, 4 Feb 2022 01:28:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEB8C061714; Thu, 3 Feb 2022 22:28:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77903B82FF0; Fri, 4 Feb 2022 06:28:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBC95C004E1; Fri, 4 Feb 2022 06:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643956107; bh=QaFOZ+4F9bVAF26M1HaVC5kjbiVDzIfY69jkftb6Kao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b9ngHE683pVzCGLDEjg491rrD5f6vfgfZUE06M7/XMoPJEmYmGSHLSU9NmKeeAOtw uyHttVx16YZbBlN9iAmOdfYLBCbstjpUytRpE6jy+BP8WAf6kzrDZKENykhFdNrFEM j2xP2uhqLJyBld79JNy4sQzvZGhg4+h/uM8Jc9q56sHW7sSbd0SU/K+q5nBddJ19NE aKCWCl7FrlSaqGYeC263P60on+RXOp9sRjfXBj5Egt7bMmrvn+Cch/R05SmqGuxGeL joZglMI26btTOAKwxwTzpMfo5GmjefOEWnot7IusAJjMCei9lt6Peo1/BQ48k8dVou PHMFm7gKDSSUg== Date: Fri, 4 Feb 2022 08:27:59 +0200 From: Jarkko Sakkinen To: Yael Tiomkin Cc: Martin Ross , corbet@lwn.net, dhowells@redhat.com, jejb@linux.ibm.com, jmorris@namei.org, keyrings@vger.kernel.org, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module , serge@hallyn.com, Mimi Zohar Subject: Re: [PATCH v4] KEYS: encrypted: Instantiate key with user-provided decrypted data Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 03:56:44PM -0500, Yael Tiomkin wrote: > On Wed, Jan 26, 2022 at 9:51 AM Jarkko Sakkinen wrote: > > > > On Wed, Jan 26, 2022 at 04:47:22PM +0200, Jarkko Sakkinen wrote: > > > On Tue, Jan 18, 2022 at 01:26:05PM -0500, Martin Ross wrote: > > > > Hi Jarkko, > > > > > > > > I have been working with Yael on this project so I thought I might add > > > > a bit of background here around the use case that this series of > > > > patches is trying to address. > > > > > > > > At a high level we are trying to provide users of encryption that have > > > > key management hierarchies a better tradeoff between security and > > > > availability. For available and performance reasons master keys often > > > > need to be released (or derived/wrapped keys created) outside of a KMS > > > > to clients (which may in turn further wrap those keys in a series of > > > > levels). What we are trying to do is provide a mechanism where the > > > > wrapping/unwrapping of these keys is not dependent on a remote call at > > > > runtime. e.g. To unwrap a key if you are using AWS KMS or Google > > > > Service you need to make an RPC. In practice to defend against > > > > availability or performance issues, designers end up building their > > > > own kms and effectively encrypting everything with a DEK. The DEK > > > > encrypts same set as the master key thereby eliminating the security > > > > benefit of keeping the master key segregated in the first place. > > > > Mainly this part (would be enough to explain why it is there). > > > > BR, Jarkko > > Hi Jarkko, > > As for the commit message, WDYT about the following: > > KEYS: encrypted: Instantiate key with user-provided decrypted data > > For availability and performance reasons master keys often need to be > released outside of a KMS to clients. It would be beneficial to provide a > mechanism where the wrapping/unwrapping of DEKs is not dependent > on a remote call at runtime yet security is not (or only minimally) compromised. > Master keys could be securely stored in the Kernel and be used to wrap/unwrap > keys from userspace. > > The encrypted.c class supports instantiation of encrypted keys with > either an already-encrypted key material, or by generating new key > material based on random numbers. This patch defines a new datablob > format: [] > that allows to inject and encrypt user-provided > decrypted data. > > > I want to make sure we're on the same page before publishing a new version. > > Thanks, > Yael It looks really good. /Jarkko