mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Frederick Lawler <fred@cloudflare.com>
Cc: davem@davemloft.net, ebiggers@google.com, hch@lst.de,
	smueller@chronox.de, dhowells@redhat.com, omosnace@redhat.com,
	keyrings@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org, kernel-team@cloudflare.com
Subject: Re: [PATCH 1/1] crypto: af_alg - Support symmetric encryption via keyring keys
Date: Fri, 28 Oct 2022 13:02:36 +0800	[thread overview]
Message-ID: <Y1tibAzBGI3F+6xw@gondor.apana.org.au> (raw)
In-Reply-To: <20221017192500.485962-1-fred@cloudflare.com>

On Mon, Oct 17, 2022 at 02:25:00PM -0500, Frederick Lawler wrote:
> We want to leverage keyring to store sensitive keys, and then use those
> keys for symmetric encryption via the crypto API. Among the key types we
> wish to support are: user, logon, encrypted, and trusted.
> 
> User key types are already able to have their data copied to user space,
> but logon does not support this. Further, trusted and encrypted keys will
> return their encrypted data back to user space on read, which does not
> make them ideal for symmetric encryption.
> 
> To support symmetric encryption for these key types, add a new
> ALG_SET_KEY_BY_KEY_SERIAL setsockopt() option to the crypto API. This
> allows users to pass a key_serial_t to the crypto API to perform
> symmetric encryption. The behavior is the same as ALG_SET_KEY, but
> the crypto key data is copied in kernel space from a keyring key,
> which allows for the support of logon, encrypted, and trusted key types.
> 
> Keyring keys must have the KEY_(POS|USR|GRP|OTH)_SEARCH permission set
> to leverage this feature. This follows the asymmetric_key type where key
> lookup calls eventually lead to keyring_search_rcu() without the
> KEYRING_SEARCH_NO_CHECK_PERM flag set.
> 
> Signed-off-by: Frederick Lawler <fred@cloudflare.com>
> ---
> RFC: https://lore.kernel.org/all/20221004212927.1539105-1-fred@cloudflare.com/
> 
> We have an idea for handling the case of leaking key data with bad
> algorithms, but asymmetric keys currently have the same problem if any were
> added as a akcipher type. If KEY_*_SEARCH is not good enough, we thought
> of possibly implementing a KConfig such that we disable leaky algorithms
> when selected, or possibly the inverse where if a leaky algorithm is
> enabled, we don't allow to enable this. The problem there is now there's
> a list to maintain.
> ---
>  Documentation/crypto/userspace-if.rst |  15 ++-
>  crypto/af_alg.c                       | 135 +++++++++++++++++++++++++-
>  include/uapi/linux/if_alg.h           |   1 +
>  3 files changed, 147 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2022-10-28  5:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 19:25 Frederick Lawler
2022-10-28  5:02 ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1tibAzBGI3F+6xw@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=ebiggers@google.com \
    --cc=fred@cloudflare.com \
    --cc=hch@lst.de \
    --cc=kernel-team@cloudflare.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=smueller@chronox.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®