Skip to contentSkip to conversation

pfkey: Deprecate pfkey

RFC PATCH In review Steffen Klassert 5 participants 5 messages Jul 4, 2025 – Jul 9, 2025

Subsystems (3)
lore
Share & tools
lore

Steffen Klassert

author maintainer
#0 lore raw

RFC PATCH 1/1 pfkey: Deprecate pfkey

The pfkey user configuration interface was replaced by the netlink user configuration interface more than a decade ago. In between all maintained IKE implementations moved to the netlink interface. So let 'config NET_KEY' default to no in Kconfig. The pfkey code will be removed in a second step.

---
 net/xfrm/Kconfig | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
net/xfrm/Kconfig +7 -4
index f0157702718f..aedea7a892db 100644
@@ -110,14 +110,17 @@ config XFRM_IPCOMP
 	select CRYPTO_DEFLATE
 
 config NET_KEY
-	tristate "PF_KEY sockets"
+	tristate "PF_KEY sockets (deprecated)"
 	select XFRM_ALGO
+	default n
 	help
 	  PF_KEYv2 socket family, compatible to KAME ones.
-	  They are required if you are going to use IPsec tools ported
-	  from KAME.
 
-	  Say Y unless you know what you are doing.
+	  The PF_KEYv2 socket interface is deprecated and
+	  scheduled for removal. Please use the netlink
+	  interface (XFRM_USER) to configure IPsec.
+
+	  If unsure, say N.
 
 config NET_KEY_MIGRATE
 	bool "PF_KEY MIGRATE"
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · Steffen Klassert

The pfkey user configuration interface was replaced by the netlink user configuration interface more than a decade ago. In between all maintained IKE implementations moved to the netlink interface. So let 'config NET_KEY' default to no in Kconfig. The pfkey code will be removed in a second step.

I'd suggest to also do something like
b144fcaf46d4 ("dccp: Print deprecation notice.")

Quoted 16 lines
---
 net/xfrm/Kconfig | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
net/xfrm/Kconfig +1 -1
index f0157702718f..aedea7a892db 100644
@@ -110,14 +110,17 @@ config XFRM_IPCOMP
 	select CRYPTO_DEFLATE
 
 config NET_KEY
-	tristate "PF_KEY sockets"
+	tristate "PF_KEY sockets (deprecated)"
 	select XFRM_ALGO

net/xfrm/Kconfig config XFRM_IPCOMP · line 121

Quoted 10 lines
net/xfrm/Kconfig +4 -3
+	default n
 	help
 	  PF_KEYv2 socket family, compatible to KAME ones.
-	  They are required if you are going to use IPsec tools ported
-	  from KAME.
 
-	  Say Y unless you know what you are doing.
+	  The PF_KEYv2 socket interface is deprecated and
+	  scheduled for removal. Please use the netlink
+	  interface (XFRM_USER) to configure IPsec.

Perhaps this should mention that all existing IKE daemons no longer need this resp. that this is only required for ancient/unmaintained KAME tools?

maintainer
#2 lore raw
In reply to Steffen Klassert

net/xfrm/Kconfig config XFRM_IPCOMP · line 115

Quoted 6 lines · Steffen Klassert

config NET_KEY

net/xfrm/Kconfig +2 -1
-	tristate "PF_KEY sockets"
+	tristate "PF_KEY sockets (deprecated)"
 	select XFRM_ALGO
+	default n

The default is always n so this is redundant.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Acked-by on v1 1/1
#3 lore raw
In reply to Steffen Klassert
Quoted 6 lines · Steffen Klassert via Devel

The pfkey user configuration interface was replaced by the netlink user configuration interface more than a decade ago. In between all maintained IKE implementations moved to the netlink interface. So let 'config NET_KEY' default to no in Kconfig. The pfkey code will be removed in a second step.

I have tested libreswan and strongSwan CONFIG_NET_KEY=n; without HW offload.

And I would also like to get a confirmation Hardware offload, crypt offload and packet offload works with CONFIG_NET_KEY n.

I undderstand this patch is independent of HW offload.

However, IMHO it is good to confirm now. Otherwise I imagine distributions will flip CONFIG_NET_KEY=y to get HW offload working, which will make it harder to depreciate PF_KEY/NET_KEY

Paul or Leon - would you like to confirm with
CONFIG_NET_KEY=n XFRM HW offload still works?

-antony

Quoted 36 lines
---
 net/xfrm/Kconfig | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
net/xfrm/Kconfig +7 -4
index f0157702718f..aedea7a892db 100644
@@ -110,14 +110,17 @@ config XFRM_IPCOMP
 	select CRYPTO_DEFLATE
 
 config NET_KEY
-	tristate "PF_KEY sockets"
+	tristate "PF_KEY sockets (deprecated)"
 	select XFRM_ALGO
+	default n
 	help
 	  PF_KEYv2 socket family, compatible to KAME ones.
-	  They are required if you are going to use IPsec tools ported
-	  from KAME.
 
-	  Say Y unless you know what you are doing.
+	  The PF_KEYv2 socket interface is deprecated and
+	  scheduled for removal. Please use the netlink
+	  interface (XFRM_USER) to configure IPsec.
+
+	  If unsure, say N.
 
 config NET_KEY_MIGRATE
 	bool "PF_KEY MIGRATE"
Signature · 5 lines
2.43.0

-- 
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Acked-by on v1 1/1
#4 lore raw
In reply to Steffen Klassert
Quoted 27 lines · Steffen Klassert

The pfkey user configuration interface was replaced by the netlink user configuration interface more than a decade ago. In between all maintained IKE implementations moved to the netlink interface. So let 'config NET_KEY' default to no in Kconfig. The pfkey code will be removed in a second step.

---
 net/xfrm/Kconfig | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
net/xfrm/Kconfig +2 -3
index f0157702718f..aedea7a892db 100644
@@ -110,14 +110,17 @@ config XFRM_IPCOMP
 	select CRYPTO_DEFLATE
 
 config NET_KEY
-	tristate "PF_KEY sockets"
+	tristate "PF_KEY sockets (deprecated)"
 	select XFRM_ALGO
+	default n
 	help
 	  PF_KEYv2 socket family, compatible to KAME ones.
-	  They are required if you are going to use IPsec tools ported
-	  from KAME.

net/xfrm/Kconfig config XFRM_IPCOMP · line 126

Quoted 10 lines
net/xfrm/Kconfig +5 -1
 
-	  Say Y unless you know what you are doing.
+	  The PF_KEYv2 socket interface is deprecated and
+	  scheduled for removal. Please use the netlink
+	  interface (XFRM_USER) to configure IPsec.
+
+	  If unsure, say N.
 
 config NET_KEY_MIGRATE
 	bool "PF_KEY MIGRATE"

While we currently use this in our regression tests to test our PF_KEY implementation (which is used on FreeBSD/macOS), I'm fine with deprecating and eventually removing it.

Regards,
Tobias