Skip to contentSkip to conversation

net: avoid inet dependency on aes crypto

PATCH In review Florian Westphal 3 participants 3 messages Apr 22, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: avoid inet dependency on aes crypto

commit 798b2cbf9227b1bd7d37ae9af4d9c750e6f4de9c
(net: Add INET dependency on aes crypto for the sake of TCP fastopen.) results in aes-asm module no longer being loaded when AES cipher is requested, due to CRYPTO_AES=y.

However, there is no link-time dependency on aes. Drop dep and instead set "default m" for aes crypto if inet is enabled.

---
 crypto/Kconfig |    1 +
 net/Kconfig    |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)
crypto/Kconfig +1 -0
index 05c0ce5..151b3e0 100644
@@ -584,6 +584,7 @@ comment "Ciphers"
 
 config CRYPTO_AES
 	tristate "AES cipher algorithms"
+	default m if INET
 	select CRYPTO_ALGAPI
 	help
 	  AES cipher algorithms (FIPS-197). AES uses the Rijndael
net/Kconfig +0 -1
index 1a22216..a1d2cab 100644
@@ -62,7 +62,6 @@ source "net/iucv/Kconfig"
 config INET
 	bool "TCP/IP networking"
 	select CRYPTO
-	select CRYPTO_AES
 	---help---
 	  These are the protocols used on the Internet and on most local
 	  Ethernets. It is highly recommended to say Y here (this will enlarge
Signature · 1 line
1.7.8.6
maintainer
#1 lore raw

From: Florian Westphal <[email protected]>
Date: Mon, 22 Apr 2013 15:30:03 +0200

Quoted 9 lines

commit 798b2cbf9227b1bd7d37ae9af4d9c750e6f4de9c
(net: Add INET dependency on aes crypto for the sake of TCP fastopen.) results in aes-asm module no longer being loaded when AES cipher is requested, due to CRYPTO_AES=y.

However, there is no link-time dependency on aes. Drop dep and instead set "default m" for aes crypto if inet is enabled.

This is terrible on so many levels.

If the assembler versions of the AES module can't be loaded properly when AES is built statically into the kernel, don't work around it, fix it instead.

#2 lore raw
Quoted 11 lines · David Miller

From: Florian Westphal <[email protected]>
Date: Mon, 22 Apr 2013 15:30:03 +0200

Quoted 8 lines

commit 798b2cbf9227b1bd7d37ae9af4d9c750e6f4de9c
(net: Add INET dependency on aes crypto for the sake of TCP fastopen.) results in aes-asm module no longer being loaded when AES cipher is requested, due to CRYPTO_AES=y.

However, there is no link-time dependency on aes. Drop dep and instead set "default m" for aes crypto if inet is enabled.

Quoted 7 lines
Quoted 1 line

This is terrible on so many levels.

If the assembler versions of the AES module can't be loaded properly when AES is built statically into the kernel, don't work around it, fix it instead.

On x86 the appropriate optimised aes implementation should still be loaded based on an 'x86cpu' alias. I don't know whether it will end up being used.

It doesn't look like anything similar has been done for other architectures yet, but that is probably the way to go.

Ben.

Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.