From: Prithvi Tambewagh <activprithvi@gmail.com>
To: mkl@pengutronix.de, socketcan@hartkopp.net
Cc: Prithvi Tambewagh <activprithvi@gmail.com>,
linux-can@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: Question about to KMSAN: uninit-value in can_receive
Date: Mon, 17 Nov 2025 23:00:12 +0530 [thread overview]
Message-ID: <20251117173012.230731-1-activprithvi@gmail.com> (raw)
In-Reply-To: <68bae75b.050a0220.192772.0190.GAE@google.com>
Hello,
The call trace suggests that the bug appears to be due to effect of change
in headroom by pskb_header_expand(). The new headroom remains uninitialized
and when can_receive tries accessing can_skb_prv(skb)->skbcnt, indirectly
skb->head is accessed which causes KMSAN uninitialized value read bug.
To fix this bug, I think we can call can_dropped_invalid_skb() in can_rcv()
just before calling can_receive(). Further, we can add a condition for these
sk_buff with uninitialized headroom to initialize the skb, the way it had
been done in the patch for an earlier packet injection case in a similar
KMSAN bug:
https://lore.kernel.org/linux-can/20191207183418.28868-1-socketcan@hartkopp.net/
However, I am not getting on what basis can I filter the sk_buff so that
only those with an uninitialized headroom will be initialized via this path.
Is this the correct approach?
Thank you,
Prithvi
next prev parent reply other threads:[~2025-11-17 17:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 13:36 [syzbot] [can?] KMSAN: uninit-value in can_receive (3) syzbot
2025-11-17 17:30 ` Prithvi Tambewagh [this message]
2025-11-29 17:04 ` Question about to KMSAN: uninit-value in can_receive Oliver Hartkopp
2025-11-30 12:04 ` Feedback provided on question about " Prithvi Tambewagh
2025-11-30 12:44 ` Question about to " Oliver Hartkopp
2025-11-30 17:29 ` Prithvi Tambewagh
2025-11-30 19:09 ` Oliver Hartkopp
2025-12-07 18:45 ` Prithvi
2025-12-20 17:33 ` Prithvi
2025-12-21 18:29 ` [bpf, xdp] headroom - was: " Oliver Hartkopp
2025-12-21 19:06 ` Marc Kleine-Budde
2025-12-21 19:42 ` Oliver Hartkopp
2026-01-02 15:36 ` Prithvi
2026-01-02 20:04 ` Jakub Kicinski
2026-01-03 12:20 ` Oliver Hartkopp
2026-01-04 15:42 ` Jakub Kicinski
2026-01-05 13:47 ` Oliver Hartkopp
2026-01-05 23:26 ` Jakub Kicinski
2026-01-06 12:04 ` Oliver Hartkopp
2026-01-07 0:23 ` Jakub Kicinski
2026-01-07 15:34 ` Oliver Hartkopp
2026-01-07 19:10 ` Oliver Hartkopp
2026-01-08 15:17 ` Jakub Kicinski
2026-01-08 16:27 ` Oliver Hartkopp
2026-01-05 21:30 ` Andrii Nakryiko
2026-01-05 22:11 ` Daniel Borkmann
2025-11-28 17:48 ` Feedback on question about " Prithvi Tambewagh
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=20251117173012.230731-1-activprithvi@gmail.com \
--to=activprithvi@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=socketcan@hartkopp.net \
--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®