Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5505594pxb; Wed, 26 Jan 2022 13:38:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDPwZwm1KH5vEf3r9m4w+dbLhmm7DqyEcDd2reeVAgde/7NvqlyGt6EBnxel/uY+6iz2SU X-Received: by 2002:a17:902:d486:: with SMTP id c6mr351786plg.133.1643233127181; Wed, 26 Jan 2022 13:38:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643233127; cv=none; d=google.com; s=arc-20160816; b=Q1NwBAiDpwtTtN41uLbUGzCfw94Co6CsR4KFBJ9tFeD2m6arWJdnQr2q+VaZuoPhmZ cbzAEabXBz87EgMTooOv2FXZ0h9Rfrx0hxWPqXo5bnBxjnnm+fS5wKCEDxj21296/DCn IBNG527nw8YppPa0Cdhig7WV1BmNNZjWDddqQEA1+SkEqTMlsEzcJEr6FHkLUpt/iSpk dhjqjBeplzwUngKIEYuA4gEXhwmE77tM1/eQGqC2koP6wDY/+XrBpUr51iSQRxe4603N Z8G6nYD+egsRAITGRzgEqxSXEfh1hZ1yNhGuvdoxfzyB75W6rSAA/59tPoTdmHOvarNL FEwA== 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=W49aVXIxJ0JtvYSilp9+OpD6Ix0FTATaBexvuG+1/PM=; b=bxEVe9AvfJE9VosGj+YRb8N3GQoAYaCbVddRUZaDHzTXXQTM4hMXJhkutJbUrocKaw tg4HHzq9RsiuJcTudD5d1uvJ09P8gBvejfMPSGyiu3PWfnzoSjJ4HTFK5NIjSf7JOpgT r/5Hzk5y8ju/BVuDbv6GjiXBvV833mmvNNgRdnp4H/E92yWSZM7dma3PYFVAHvecv+Zw ehzid1sqgf/AHTu3sbqakwwceuMklhKK52oHyGQDOW3LfWms1OFVPTHnm9tsk7mx1/YU 7IojGYRyoPOXmbmOgPXv54JOSAF1um1cOza6bAREqVNSyQ/ThUR/+hyiRwUSGRxXswp7 rGaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IFrBbe9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bj7si316814plb.408.2022.01.26.13.38.35; Wed, 26 Jan 2022 13:38:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IFrBbe9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S242336AbiAZOrn (ORCPT + 99 others); Wed, 26 Jan 2022 09:47:43 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:59566 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242349AbiAZOrm (ORCPT ); Wed, 26 Jan 2022 09:47:42 -0500 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 CC470B81E4D; Wed, 26 Jan 2022 14:47:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07E56C340E3; Wed, 26 Jan 2022 14:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643208459; bh=PvgdKDY6x/qQEODxXtw3/fdzN/Ym+5XzciPDitqd/AU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IFrBbe9UuBszBggW1IeTSkoFLoEId1G342h3kpYhtjBcZwepj3wiGy/GZCfmU7b3S +dIBoDEZT0sgO48R3eWHrN79Pg7RMX5vGt5sctZMIoTPo4EI1DJasGwg/oOnlHISQ+ Ewep9+DYxCdu0cYW5qE1EaidUBzSiqfwUcZtVoZpU7Y8Ql+9ttwKXFeYvphAzTLvG8 bZKk5o1OSwXKS2ecxKzSzC2kv1ms/x1g82/L+naPIDCpjhcSWBZPX5sNUEUVYn48T8 kQoUr/k3o7HPIW5qQipjt3RymhOF3b/VVDH1EzOTT4Y+sNHfQRx69P5J0GuQMBPQZ3 DOPd9mN9UI6KQ== Date: Wed, 26 Jan 2022 16:47:19 +0200 From: Jarkko Sakkinen To: Martin Ross Cc: 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@vger.kernel.org, serge@hallyn.com, Yael Tiomkin , 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 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. > > We are building a mechanism to create a security boundary in the > kernel that allows these master keys to be stored in the kernel and > used to wrap/unwrap keys via less trusted user processes. The other > goal here is to eliminate the complexity and statefulness required to > do this today which would be to create a trusted daemon or process on > the machine. Concretely this means that since the user process will > not have the master key the system designer has better options. One > obvious advantage is that any core dumps or code injection attacks > won't be able to trivially grab the master key from the process or the > linux keyring. Once in the kernel this functionality can be > transparently integrated into user space crypto libraries that have > existing key management functionality. > > Hope this helps and happy to answer any further questions! > > M Thank you. It indeed does. I think it is a good explanation. Maybe the way to move forward would be bring this context at leat a bit to the documentation update? /Jarkko