Message ID | 20220601103349.2297361-2-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 9c90c9b3e50e16d03c7f87d63e9db373974781e0 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/2] Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" | expand |
Hello: This series was applied to netdev/net.git (master) by Steffen Klassert <steffen.klassert@secunet.com>: On Wed, 1 Jun 2022 12:33:48 +0200 you wrote: > From: Michal Kubecek <mkubecek@suse.cz> > > This reverts commit 4dc2a5a8f6754492180741facf2a8787f2c415d7. > > A non-zero return value from pfkey_broadcast() does not necessarily mean > an error occurred as this function returns -ESRCH when no registered > listener received the message. In particular, a call with > BROADCAST_PROMISC_ONLY flag and null one_sk argument can never return > zero so that this commit in fact prevents processing any PF_KEY message. > One visible effect is that racoon daemon fails to find encryption > algorithms like aes and refuses to start. > > [...] Here is the summary with links: - [1/2] Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" https://git.kernel.org/netdev/net/c/9c90c9b3e50e - [2/2] xfrm: do not set IPv4 DF flag when encapsulating IPv6 frames <= 1280 bytes. https://git.kernel.org/netdev/net/c/6821ad877034 You are awesome, thank you!
diff --git a/net/key/af_key.c b/net/key/af_key.c index 339d95df19d3..d93bde657359 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -2826,10 +2826,12 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb void *ext_hdrs[SADB_EXT_MAX]; int err; - err = pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL, - BROADCAST_PROMISC_ONLY, NULL, sock_net(sk)); - if (err) - return err; + /* Non-zero return value of pfkey_broadcast() does not always signal + * an error and even on an actual error we may still want to process + * the message so rather ignore the return value. + */ + pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL, + BROADCAST_PROMISC_ONLY, NULL, sock_net(sk)); memset(ext_hdrs, 0, sizeof(ext_hdrs)); err = parse_exthdrs(skb, hdr, ext_hdrs);