From: syzbot <syzbot+d7d8c418e8317899e88c@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [PATCH] can: ucan: Correct the size parameter
Date: Mon, 17 Feb 2025 10:16:43 -0800 [thread overview]
Message-ID: <67b37d0b.050a0220.173698.003a.GAE@google.com> (raw)
In-Reply-To: <67b323a4.050a0220.173698.002b.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] can: ucan: Correct the size parameter
Author: zoo868e@gmail.com
According to the comment, the size parameter is only required when
@dst is not an array, or when the copy needs to be smaller than
sizeof(@dst). Since the source is a `union ucan_ctl_payload`, the
correct size should be sizeof(union ucan_ctl_payload).
#syz test
Signed-off-by: Matt Jan <zoo868e@gmail.com>
---
drivers/net/can/usb/ucan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/ucan.c b/drivers/net/can/usb/ucan.c
index 39a63b7313a4..1ccef00388ae 100644
--- a/drivers/net/can/usb/ucan.c
+++ b/drivers/net/can/usb/ucan.c
@@ -1533,7 +1533,7 @@ static int ucan_probe(struct usb_interface *intf,
if (ret > 0) {
/* copy string while ensuring zero termination */
strscpy(firmware_str, up->ctl_msg_buffer->raw,
- sizeof(union ucan_ctl_payload) + 1);
+ sizeof(union ucan_ctl_payload));
} else {
strcpy(firmware_str, "unknown");
}
--
2.25.1
next prev parent reply other threads:[~2025-02-17 18:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 11:55 [syzbot] [can?] WARNING in ucan_probe syzbot
2025-02-17 12:57 ` Marc Kleine-Budde
2025-02-17 17:59 ` [syzbot] syzbot
2025-02-17 18:16 ` syzbot [this message]
2025-02-17 19:04 ` [PATCH] can: ucan: Correct the size parameter Matt Jan
2025-02-18 2:22 ` Vincent Mailhol
2025-02-18 7:37 ` Marc Kleine-Budde
2025-02-18 14:26 ` Vincent Mailhol
2025-02-18 14:27 ` Marc Kleine-Budde
2025-02-18 14:32 ` [PATCH] can: ucan: fix out of bound read in strscpy() source Vincent Mailhol
2025-02-18 15:12 ` Marc Kleine-Budde
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=67b37d0b.050a0220.173698.003a.GAE@google.com \
--to=syzbot+d7d8c418e8317899e88c@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
--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
Powered by JetHome