Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1276339

Re: [RFC PATCH 2/2] Crypto kernel tls socket

From Hannes Frederic Sowa <hannes@stressinduktion.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 2/2] Crypto kernel tls socket
Date 2015-11-24 12:30 +0100
Message-ID <qyjXk-7sn-13@gated-at.bofh.it> (permalink)
References <qy3pw-51A-13@gated-at.bofh.it> <qy3pw-51A-23@gated-at.bofh.it> <qyjaW-6V9-11@gated-at.bofh.it> <qyjDY-7lE-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

Stephan Mueller <smueller@chronox.de> writes:

> Am Dienstag, 24. November 2015, 18:34:55 schrieb Herbert Xu:
>
> Hi Herbert,
>
>>On Mon, Nov 23, 2015 at 09:43:02AM -0800, Dave Watson wrote:
>>> Userspace crypto interface for TLS.  Currently supports gcm(aes) 128bit
>>> only, however the interface is the same as the rest of the SOCK_ALG
>>> interface, so it should be possible to add more without any user interface
>>> changes.
>>
>>SOCK_ALG exists to export crypto algorithms to user-space.  So if
>>we decided to support TLS as an algorithm then I guess this makes
>>sense.
>>
>>However, I must say that it wouldn't have been my first pick.  I'd
>>imagine a TLS socket to look more like a TCP socket, or perhaps a
>>KCM socket as proposed by Tom.
>
> If I may ask: what is the benefit of having TLS in kernel space? I do not see 
> any reason why higher-level protocols should be in the kernel as they do not 
> relate to accessing hardware.

There are some crypto acclerators out there so that putting tls into the
kernel would give a net benefit, because otherwise user space has to
copy data into the kernel for device access and back to user space until
it can finally be send out on the wire.

Since processors provide aesni and other crypto extensions as part of
their instruction set architecture, this, of course, does not make sense
any more.

> The only reason I could fathom is to keep the negotiated keys in a secure 
> realm. But that could be done without having parts or the whole TLS protocol 
> stack in the kernel. If the key management should stay in the kernel as a 
> protection domain, I would rather think that the kernel should offer a plug-
> and-play of raw ciphers where user space is responsible to form a protocol. 
> This way, we do not limit such key management to TLS, but allow any kind of 
> protocol to use it.
>
> E.g. the kernel performs the key transport with RSA or key agreement with DH 
> using keyring-based key material. The resulting shared secret is again 
> maintained in the key ring where user space can use the symmetric ciphers of 
> the kernel with those keys. User space would only see references to keys but 
> no real keys. However, only user space knows when to invoke what cipher to 
> implement a specific protocol.

You could also keep the secret in a master process and talk to that via
ipc.

Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/2] Crypto kernel TLS socket Dave Watson <davejwatson@fb.com> - 2015-11-23 18:50 +0100
  [RFC PATCH 1/2] Crypto support aesni rfc5288 Dave Watson <davejwatson@fb.com> - 2015-11-23 18:50 +0100
    Re: [RFC PATCH 1/2] Crypto support aesni rfc5288 Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-24 11:40 +0100
  [RFC PATCH 2/2] Crypto kernel tls socket Dave Watson <davejwatson@fb.com> - 2015-11-23 18:50 +0100
    Re: [RFC PATCH 2/2] Crypto kernel tls socket Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-11-23 20:30 +0100
      Re: [RFC PATCH 2/2] Crypto kernel tls socket Dave Watson <davejwatson@fb.com> - 2015-11-23 22:50 +0100
        Re: [RFC PATCH 2/2] Crypto kernel tls socket Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-11-23 23:00 +0100
    Re: [RFC PATCH 2/2] Crypto kernel tls socket Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-24 11:40 +0100
      Re: [RFC PATCH 2/2] Crypto kernel tls socket Stephan Mueller <smueller@chronox.de> - 2015-11-24 12:10 +0100
        Re: [RFC PATCH 2/2] Crypto kernel tls socket Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-11-24 12:30 +0100
          Re: [RFC PATCH 2/2] Crypto kernel tls socket Phil Sutter <phil@nwl.cc> - 2015-11-24 13:00 +0100
            Re: [RFC PATCH 2/2] Crypto kernel tls socket Stephan Mueller <smueller@chronox.de> - 2015-11-24 13:40 +0100
          Re: [RFC PATCH 2/2] Crypto kernel tls socket Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-11-24 13:00 +0100
          Re: [RFC PATCH 2/2] Crypto kernel tls socket Stephan Mueller <smueller@chronox.de> - 2015-11-24 13:40 +0100
  Re: [RFC PATCH 0/2] Crypto kernel TLS socket Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-11-23 20:20 +0100

csiph-web