From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+be97dd4da14ae88b6ba4@syzkaller.appspotmail.com
Cc: davem@davemloft.net, edumazet@google.com,
herbert@gondor.apana.org.au, horms@kernel.org, kuba@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, steffen.klassert@secunet.com,
syzkaller-bugs@googlegroups.com
Subject: [PATCH] key: No support for family zero
Date: Sun, 19 Oct 2025 10:34:11 +0800 [thread overview]
Message-ID: <tencent_57525DE2DDF41911CFDB8DF525A08D9D9207@qq.com> (raw)
In-Reply-To: <68f1d9d6.050a0220.91a22.0419.GAE@google.com>
When setting the extended skb data for sadb_x_ipsecrequest, the requested
extended data size exceeds the allocated skb data length, triggering the
reported bug.
Because family only supports AF_INET and AF_INET6, other values will cause
pfkey_sockaddr_fill() to fail, which in turn causes set_ipsecrequest() to
fail.
Therefore, a workaround is available here: using a family value of 0 to
resolve the issue of excessively large extended data length.
syzbot reported:
kernel BUG at net/core/skbuff.c:212!
Call Trace:
skb_over_panic net/core/skbuff.c:217 [inline]
skb_put+0x159/0x210 net/core/skbuff.c:2583
skb_put_zero include/linux/skbuff.h:2788 [inline]
set_ipsecrequest+0x73/0x680 net/key/af_key.c:3532
Fixes: 08de61beab8a ("[PFKEYV2]: Extension for dynamic update of endpoint address(es)")
Reported-by: syzbot+be97dd4da14ae88b6ba4@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=be97dd4da14ae88b6ba4
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
net/key/af_key.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 2ebde0352245..e658c129b38f 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3526,6 +3526,9 @@ static int set_ipsecrequest(struct sk_buff *skb,
int socklen = pfkey_sockaddr_len(family);
int size_req;
+ if (!family)
+ return -EINVAL;
+
size_req = sizeof(struct sadb_x_ipsecrequest) +
pfkey_sockaddr_pair_size(family);
--
2.43.0
next prev parent reply other threads:[~2025-10-19 2:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 5:53 [syzbot] [net?] kernel BUG in set_ipsecrequest syzbot
2025-10-17 10:53 ` syzbot
2025-10-19 2:34 ` Edward Adam Davis [this message]
2025-10-27 21:00 ` [PATCH] key: No support for family zero Simon Horman
2025-10-19 18:29 ` [syzbot] [net?] kernel BUG in set_ipsecrequest shaurya
2025-10-19 18:32 ` syzbot
2025-10-20 2:57 ` Forwarded: [Testing] net: key: Validate address family in set_ipsecrequest() syzbot
2025-10-20 7:30 ` Forwarded: [PATCH] Fix integer overflow " syzbot
2025-10-20 7:54 ` Forwarded: Re: [syzbot] [net?] kernel BUG in set_ipsecrequest syzbot
2025-10-20 11:19 ` Forwarded: syzbot
2025-10-21 3:00 ` [PATCH] fix integer overflow in set_ipsecrequest clingfei
2025-10-23 12:24 ` [PATCH net] net: key: Fix potential " clingfei
2025-10-27 20:37 ` Simon Horman
2026-06-24 13:29 ` Forwarded: syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_57525DE2DDF41911CFDB8DF525A08D9D9207@qq.com \
--to=eadavis@qq.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
--cc=syzbot+be97dd4da14ae88b6ba4@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®