Re: [syzbot] [atm?] KMSAN: uninit-value in atmtcp_c_send
From: Kuniyuki Iwashima
Date: Thu Jun 12 2025 - 23:01:00 EST
From: syzbot <syzbot+1d3c235276f62963e93a@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Jun 2025 19:40:03 -0700
> Hello,
>
> syzbot tried to test the proposed patch but the build/boot failed:
>
> drivers/atm/atmtcp.c:293:24: error: use of undeclared identifier 'atmtcp_hdr'; did you mean 'atm_tcp_ops'?
Oops, I forgot struct :/
#syz test
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
index d4aa0f353b6c..96c0969ce584 100644
--- a/drivers/atm/atmtcp.c
+++ b/drivers/atm/atmtcp.c
@@ -288,7 +288,11 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
struct sk_buff *new_skb;
int result = 0;
- if (!skb->len) return 0;
+ if (!skb->len)
+ return 0;
+ if (skb->len < sizeof(struct atmtcp_hdr))
+ return -EINVAL;
+
dev = vcc->dev_data;
hdr = (struct atmtcp_hdr *) skb->data;
if (hdr->length == ATMTCP_HDR_MAGIC) {