From nobody Fri Dec 19 12:48:01 2025 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3989252900 for ; Sun, 7 Dec 2025 03:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765078165; cv=none; b=p4RD9N8fpIhHtArfQY/80IryAhP/2pqhghiK0PHwvfn0sJN+AmFVKe6Jy5/aIuZCle3lGzOJ13OId5fLsFoWTkNkPD8oidROE0UW+8RC6M/lXn3liVRjEfh1fJ8fyTqXwAk8ug/+a73EmqlyXX9aO4jItnPz1j0VcbpcRGGBq3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765078165; c=relaxed/simple; bh=SQBBXd2zh73IZ8yHjvMGViOzIR7hRCFCy5jvWu7psLo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=EfukWZHBXq40rZmPc9w3M5iqOAd58Ki8q0kMJJInVv1FjEiBoF1sXrR1xHdxOdI93kIoimF7YlcZiPQ0eJa4v/Yb+NGKUYfF3lzsjRDn6Nh2/RQlQ9IGMOWdsOYZH0lHvGTzPZYccshYX9a4i39z1X7ux9yavTYy63ovgluDQyw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-65703b66ebfso5258904eaf.0 for ; Sat, 06 Dec 2025 19:29:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765078162; x=1765682962; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G7bSPkuMDk3yuDUsQi0eixabz6RNoi5u3eHYc95KRbg=; b=UQ3begsJdfcXX/YuyGboMXMXjGN5+dheqUKBLoxpxZLrFv4dvrDrZTcFOVDItq/TVK HSseZhjqi2qctUaJ+pDNAXnsFJwmtfZbqnjmQQAMTnRpzsvY2xst7nUn4kvwKhQTqP/T 7niV9nbYnbPZ5bPL+krRUYevFT8WlZsiZh6kPKLGQcJHgJWmMpFpyO64nR3aYtQNyzEj RtThwvw74BD0jB5EuX7MwJ38W0fBSRPHW6qlH/MGcDki4T/Kwmkr5gmw8wXTS1lm4sqt xPZvBXm4g2ngBPwa9wGCsoLbkPHOQ2ClIjBTLvKNsR6xhJ9KRTitLBX/2al3CwsUkxyK SIAg== X-Gm-Message-State: AOJu0YwHJoh4mr6Zr5+JD93+h/MOd/TCCRkkscHUO+rst3NMQ9c5Cm23 9yDUGaVaAskU7NrZuPndeQjP/liTWFwS+Lbtun40/gfFwL3oMMFmkV9w5kk6LQw5HsuviG7Zhvi egb2+YA9uAOgDqxT5yNKk9znkaiEUzr862kGfRr27XL5G3UOn2rOiZGR8amc= X-Google-Smtp-Source: AGHT+IFSXPM6B8H956R6hMBmIJjaO0giFSVPfx2tO5DuF+wEFdsc15vgX+++GzJeJ8bs60If6ZsOIuQdtFDQGmd90nljy2SarJe+ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:a1cb:b0:659:9a49:8e1b with SMTP id 006d021491bc7-6599a49c37emr1312120eaf.13.1765078162223; Sat, 06 Dec 2025 19:29:22 -0800 (PST) Date: Sat, 06 Dec 2025 19:29:22 -0800 In-Reply-To: <69298e9d.a70a0220.d98e3.013a.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6934f492.a70a0220.38f243.003d.GAE@google.com> Subject: Forwarded: [PATCH] net: atm: lec: add pre_send validation to avoid uninitialized From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] net: atm: lec: add pre_send validation to avoid uninitiali= zed Author: dharanitharan725@gmail.com #syz test syzbot reported a KMSAN uninitialized-value crash caused by reading fields from struct atmlec_msg before validating that the skb contains enough linear data. A malformed short skb can cause lec_arp_update() and other handlers to access uninitialized memory. Add a pre_send() validator that ensures the message header and optional TLVs are fully present. This prevents all lec message types from reading beyond initialized skb data. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot+5dd615f890ddada54057@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D5dd615f890ddada54057 Signed-off-by: Dharanitharan R --- net/atm/lec.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/net/atm/lec.c b/net/atm/lec.c index afb8d3eb2185..c893781a490a 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -489,8 +489,33 @@ static void lec_atm_close(struct atm_vcc *vcc) module_put(THIS_MODULE); } =20 +static int lec_atm_pre_send(struct atm_vcc *vcc, struct sk_buff *skb) +{ + struct atmlec_msg *mesg; + u32 sizeoftlvs; + unsigned int msg_size =3D sizeof(struct atmlec_msg); + + /* Must contain the base message */ + if (skb->len < msg_size) + return -EINVAL; + + /* Must have at least msg_size bytes in linear data */ + if (!pskb_may_pull(skb, msg_size)) + return -EINVAL; + + mesg =3D (struct atmlec_msg *)skb->data; + sizeoftlvs =3D mesg->sizeoftlvs; + + /* Validate TLVs if present */ + if (sizeoftlvs && !pskb_may_pull(skb, msg_size + sizeoftlvs)) + return -EINVAL; + + return 0; +} + static const struct atmdev_ops lecdev_ops =3D { .close =3D lec_atm_close, + .pre_send =3D lec_atm_pre_send,=20 .send =3D lec_atm_send }; =20 --=20 2.43.0