From: Vincent Mailhol <mailhol@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>,
syzbot@lists.linux.dev, syzkaller-bugs@googlegroups.com,
syzbot ci <syzbot+ci284feacb80736eb0@syzkaller.appspotmail.com>,
biju.das.jz@bp.renesas.com, davem@davemloft.net, geert@glider.be,
kernel@pengutronix.de, kuba@kernel.org,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
stefan.maetje@esd.eu, stephane.grosjean@hms-networks.com,
zhao.xichao@vivo.com
Subject: Re: [PATCH] can: dev: fix out-of-bound read in can_set_default_mtu()
Date: Thu, 25 Sep 2025 00:21:31 +0900 [thread overview]
Message-ID: <47f88563-e3aa-40ad-a362-e851f6591a3e@kernel.org> (raw)
In-Reply-To: <20250924-monumental-impartial-auk-719514-mkl@pengutronix.de>
On 25/09/2025 at 00:13, Marc Kleine-Budde wrote:
> On 24.09.2025 23:35:44, Vincent Mailhol wrote:
>> Under normal usage, the virtual interfaces do not call can_setup(),
>> unless if trigger by a call to can_link_ops->setup().
>>
>> Patch [1] did not consider this scenario resulting in an out of bound
>> read in can_setup() when calling can_link_ops->setup() as reported by
>> syzbot ci in [2].
>>
>> Replacing netdev_priv() by safe_candev_priv() may look like a
>> potential solution at first glance but is not: can_setup() is used as
>> a callback function in alloc_netdev_mqs(). At the moment this callback
>> is called, priv is not yet fully setup and thus, safe_candev_priv()
>> would fail on physical interfaces. In other words, safe_candev_priv()
>> is solving the problem for virtual interfaces, but adding another
>> issue for physical interfaces.
>>
>> Remove the call to can_set_default_mtu() in can_setup(). Instead,
>> manually set the MTU the default CAN MTU. This decorrelates the two
>> functions, effectively removing the conflict.
>>
>> [1] can: populate the minimum and maximum MTU values
>> Link: https://lore.kernel.org/linux-can/20250923-can-fix-mtu-v3-3-581bde113f52@kernel.org/
>>
>> [2] https://lore.kernel.org/linux-can/68d3e6ce.a70a0220.4f78.0028.GAE@google.com/
>>
>> Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
>> ---
>> @Marc, please squash in
>>
>> [PATCH net-next 27/48] can: populate the minimum and maximum MTU values
>
> I've not changed the commit message of "can: populate the minimum and
> maximum MTU values", just added the note that I've squashed this fixup
> patch.
Ack. That was my intent as well. The description remains accurate. I just wrote
the patch description to keep a record of that last minute change ;)
I saw that you just added a link to the fix at the bottom, this is all we need!
> I've created a new tag: linux-can-next-for-6.18-20250924
Thanks!
Yours sincerely,
Vincent Mailhol
prev parent reply other threads:[~2025-09-24 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250924082104.595459-1-mkl@pengutronix.de>
2025-09-24 12:40 ` [syzbot ci] Re: pull-request: can-next 2025-09-24 syzbot ci
2025-09-24 13:18 ` Oliver Hartkopp
2025-09-24 13:31 ` Vincent Mailhol
2025-09-24 13:38 ` Marc Kleine-Budde
2025-09-24 13:38 ` Oliver Hartkopp
2025-09-24 14:14 ` Vincent Mailhol
2025-09-24 14:35 ` [PATCH] can: dev: fix out-of-bound read in can_set_default_mtu() Vincent Mailhol
2025-09-24 15:13 ` Marc Kleine-Budde
2025-09-24 15:21 ` Vincent Mailhol [this message]
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=47f88563-e3aa-40ad-a362-e851f6591a3e@kernel.org \
--to=mailhol@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=geert@glider.be \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
--cc=stefan.maetje@esd.eu \
--cc=stephane.grosjean@hms-networks.com \
--cc=syzbot+ci284feacb80736eb0@syzkaller.appspotmail.com \
--cc=syzbot@lists.linux.dev \
--cc=syzkaller-bugs@googlegroups.com \
--cc=zhao.xichao@vivo.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