Skip to contentSkip to conversation

pfkey: Deprecate pfkey

PATCH Superseded Steffen Klassert 4 participants 4 messages Oct 22, 2025 – Oct 23, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Steffen Klassert

author maintainer
#0 lore raw

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 remoced in a secomd step.

---

Antony, Tobias, I kept the Acked-by tags from the RFC version. Let me know if that's ok.

 net/key/af_key.c |  2 ++
 net/xfrm/Kconfig | 11 +++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
net/key/af_key.c +2 -0
index 2ebde0352245..571200433aa9 100644
@@ -3903,6 +3903,8 @@ static int __init ipsec_pfkey_init(void)
 {
 	int err = proto_register(&key_proto, 0);
 
+	pr_warn_once("PFKEY is deprecated and scheduled to be removed in 2027, "
+	             "please contact the netdev mailing list\n");
 	if (err != 0)
 		goto out;
 
net/xfrm/Kconfig +7 -4
index f0157702718f..4a62817a88f8 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
 	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. All maintained IKE daemons
+	  no longer need PF_KEY sockets. 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
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 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 remoced in a secomd step.

Quoted 8 lines

---

Antony, Tobias, I kept the Acked-by tags from the RFC version. Let me know if that's ok.

 net/key/af_key.c |  2 ++
 net/xfrm/Kconfig | 11 +++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

Thanks,

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
Reviewed-by on v1 1/1
#2 lore raw
In reply to Steffen Klassert
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 remoced in a secomd step.

nit: typos: s/remoced/removed/ and s/secomd/second/

Quoted 4 lines

The deprecation/removal plan sounds good to me.

Signature · 1 line
Sabrina
Acked-by on v1 1/1
#3 lore raw
In reply to Steffen Klassert
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 remoced in a secomd step.

No supported libreswan version still uses the old NET_KEY PFKEY API.

Paul