Skip to contentSkip to conversation

openssl: disable cryptodev by default

PATCH In review Ross Burton 4 participants 7 messages Mar 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssl: disable cryptodev by default

Cryptodev is a way for userspace to access the kernel crypto drivers (and so, hardware crypto).

Not all hardware supports cryptodev so this is something that should be enabled in a BSP layer instead of in oe-core.

---
 meta/recipes-connectivity/openssl/openssl.inc       | 2 ++
 meta/recipes-connectivity/openssl/openssl_1.0.2k.bb | 5 -----
 2 files changed, 2 insertions(+), 5 deletions(-)
meta/recipes-connectivity/openssl/openssl.inc +2 -0
index 9afa5bd..03dee0e 100644
@@ -15,7 +15,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
           "
 S = "${WORKDIR}/openssl-${PV}"
 
+PACKAGECONFIG ??= ""
 PACKAGECONFIG[perl] = ",,,"
+PACKAGECONFIG[cryptodev] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,-UHAVE_CRYPTODEV,cryptodev-linux"
 
 AR_append = " r"
 TERMIO_libc-musl = "-DTERMIOS"
meta/recipes-connectivity/openssl/openssl_1.0.2k.bb +0 -5
index 1973f81..4436ba3 100644
@@ -1,10 +1,5 @@
 require openssl.inc
 
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-DEPENDS += "cryptodev-linux"
-
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
 CFLAG_append_class-native = " -fPIC"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
Signature · 1 line
2.8.1
#1 lore raw
Quoted 5 lines · Ross Burton

Cryptodev is a way for userspace to access the kernel crypto drivers (and so, hardware crypto).

Not all hardware supports cryptodev so this is something that should be enabled in a BSP layer instead of in oe-core.

How is BSP layer supposed to enable this without being considered toxic to all other layers which might support MACHINEs with the same TUNE_PKGARCH?

Quoted 43 lines
---
 meta/recipes-connectivity/openssl/openssl.inc       | 2 ++
 meta/recipes-connectivity/openssl/openssl_1.0.2k.bb | 5 -----
 2 files changed, 2 insertions(+), 5 deletions(-)
meta/recipes-connectivity/openssl/openssl.inc +2 -0
index 9afa5bd..03dee0e 100644
@@ -15,7 +15,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
           "
 S = "${WORKDIR}/openssl-${PV}"
 
+PACKAGECONFIG ??= ""
 PACKAGECONFIG[perl] = ",,,"
+PACKAGECONFIG[cryptodev] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,-UHAVE_CRYPTODEV,cryptodev-linux"
 
 AR_append = " r"
 TERMIO_libc-musl = "-DTERMIOS"
meta/recipes-connectivity/openssl/openssl_1.0.2k.bb +0 -5
index 1973f81..4436ba3 100644
@@ -1,10 +1,5 @@
 require openssl.inc
 
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-DEPENDS += "cryptodev-linux"
-
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
 CFLAG_append_class-native = " -fPIC"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
Signature · 7 lines
2.8.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
In reply to Ross Burton
Quoted 2 lines · Ross Burton

Cryptodev is a way for userspace to access the kernel crypto drivers (and so, hardware crypto).

If the BSP does not support crypto dev, what is the harm in this? It should fall back to standard behaviors.

Quoted 2 lines

Not all hardware supports cryptodev so this is something that should be enabled in a BSP layer instead of in oe-core.

This would make the package be machine specific, which I'm not sure is good for a package like openssl. (Distro specific, I'm fine with -- machine I've got concerns.)

--Mark

Quoted 36 lines
---
 meta/recipes-connectivity/openssl/openssl.inc       | 2 ++
 meta/recipes-connectivity/openssl/openssl_1.0.2k.bb | 5 -----
 2 files changed, 2 insertions(+), 5 deletions(-)
meta/recipes-connectivity/openssl/openssl.inc +2 -0
index 9afa5bd..03dee0e 100644
@@ -15,7 +15,9 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
           "
 S = "${WORKDIR}/openssl-${PV}"
 
+PACKAGECONFIG ??= ""
 PACKAGECONFIG[perl] = ",,,"
+PACKAGECONFIG[cryptodev] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,-UHAVE_CRYPTODEV,cryptodev-linux"
 
 AR_append = " r"
 TERMIO_libc-musl = "-DTERMIOS"
meta/recipes-connectivity/openssl/openssl_1.0.2k.bb +0 -5
index 1973f81..4436ba3 100644
@@ -1,10 +1,5 @@
 require openssl.inc
 
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-DEPENDS += "cryptodev-linux"
-
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
 CFLAG_append_class-native = " -fPIC"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
#3 lore raw
Quoted 7 lines · Mark Hatle
Quoted 4 lines · Ross Burton

Cryptodev is a way for userspace to access the kernel crypto drivers (and so,
hardware crypto).

If the BSP does not support crypto dev, what is the harm in this?  It should fall back to standard behaviors.

Note that the implication here is that openssl depends on the kernel building and many other pieces of the system depend on openssl so it does bottleneck the build somewhat.

It also means a kernel rebuild ends up triggering half the userspace to rebuild which is annoying for users.

Quoted 8 lines
Quoted 3 lines

Not all hardware supports cryptodev so this is something that should be enabled
in a BSP layer instead of in oe-core.

This would make the package be machine specific, which I'm not sure is good for
a package like openssl.  (Distro specific, I'm fine with -- machine I've got
concerns.)

How commonly are kernel crypto drivers used?

Cheers,

Richard

#4 lore raw

On 8 March 2017 at 17:35, Richard Purdie <[email protected]

Quoted 9 lines

wrote:

Note that the implication here is that openssl depends on the kernel building and many other pieces of the system depend on openssl so it does bottleneck the build somewhat.

It also means a kernel rebuild ends up triggering half the userspace to rebuild which is annoying for users.

I swear I was seeing this, but can't see how it would happen now. The bulk of this patch is a sensible cleanup anyway so I shall verify my tests and most likely resubmit.

Ross

#5 lore raw
In reply to Richard Purdie
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Mark Hatle
Quoted 5 lines · Ross Burton

Cryptodev is a way for userspace to access the kernel crypto drivers (and so,
hardware crypto).

If the BSP does not support crypto dev, what is the harm in this?  It
should fall back to standard behaviors.

Quoted 6 lines

Note that the implication here is that openssl depends on the kernel building and many other pieces of the system depend on openssl so it does bottleneck the build somewhat.

It also means a kernel rebuild ends up triggering half the userspace to rebuild which is annoying for users.

Just to clarify, it doesn't depend on the kernel module, only on a header so it shouldn't be triggering kernel dependencies. I was getting some recipe names confused.

I think Ross is going to take another look at this patch...

Cheers,

Richard

#6 lore raw
In reply to Richard Purdie
Quoted 6 lines · Richard Purdie
Quoted 5 lines · Mark Hatle
Quoted 4 lines · Ross Burton

Cryptodev is a way for userspace to access the kernel crypto drivers (and so,
hardware crypto).

Quoted 6 lines
Quoted 2 lines

If the BSP does not support crypto dev, what is the harm in this? It should fall back to standard behaviors.

Note that the implication here is that openssl depends on the kernel building and many other pieces of the system depend on openssl so it does bottleneck the build somewhat.

I thought the crypto dev interface had been standardized and no longer required a specific kernel-specific instance. If this is not true, then it's effectively machine specific already.

Quoted 7 lines

It also means a kernel rebuild ends up triggering half the userspace to rebuild which is annoying for users.

Quoted 3 lines
Quoted 3 lines

Not all hardware supports cryptodev so this is something that should be enabled
in a BSP layer instead of in oe-core.

Quoted 7 lines
Quoted 5 lines

This would make the package be machine specific, which I'm not sure is good for
a package like openssl. (Distro specific, I'm fine with -- machine I've got
concerns.)

How commonly are kernel crypto drivers used?

We are seeing it used a lot, especially on IA platforms. (I have seen some usage on an arm platform, but don't remember which.)

--Mark

Quoted 4 lines

Cheers,

Richard