[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251106135658.866481-2-1599101385@qq.com>
Date: Thu, 6 Nov 2025 21:56:56 +0800
From: clingfei <clf700383@...il.com>
To: horms@...nel.org
Cc: davem@...emloft.net,
edumazet@...gle.com,
herbert@...dor.apana.org.au,
kuba@...nel.org,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
pabeni@...hat.com,
steffen.klassert@...unet.com,
eadavis@...com,
ssrane_b23@...vjti.ac.in,
syzbot+be97dd4da14ae88b6ba4@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com,
clf700383@...il.com
Subject: [PATCH 1/3] fix integer overflow in set_ipsecrequest
From: clingfei <clf700383@...il.com>
syzbot reported a kernel BUG in set_ipsecrequest() due to an skb_over_panic.
The mp->new_family and mp->old_family is u16, while set_ipsecrequest receives
family as uint8_t, causing a integer overflow and the later size_req calculation
error, which exceeds the size used in alloc_skb, and ultimately triggered the
kernel bug in skb_put.
Reported-by: syzbot+be97dd4da14ae88b6ba4@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=be97dd4da14ae88b6ba4
Signed-off-by: Cheng Lingfei <clf700383@...il.com>
---
net/key/af_key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 2ebde0352245..aa4bd29f27ea 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3518,7 +3518,7 @@ static int set_sadb_kmaddress(struct sk_buff *skb, const struct xfrm_kmaddress *
static int set_ipsecrequest(struct sk_buff *skb,
uint8_t proto, uint8_t mode, int level,
- uint32_t reqid, uint8_t family,
+ u32 reqid, uint16_t family,
const xfrm_address_t *src, const xfrm_address_t *dst)
{
struct sadb_x_ipsecrequest *rq;
--
2.34.1
Powered by blists - more mailing lists