All of lore.kernel.org
 help / color / mirror / Atom feed
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


  reply	other threads:[~2025-09-24 15:21 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  8:06 [PATCH net-next 0/48] pull-request: can-next 2025-09-24 Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 01/48] can: m_can: use us_to_ktime() where appropriate Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 02/48] MAINTAINERS: update Vincent Mailhol's email address Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 03/48] can: dev: sort includes by alphabetical order Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 04/48] can: peak: Modification of references to email accounts being deleted Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 05/48] can: rcar_canfd: Update bit rate constants for RZ/G3E and R-Car Gen4 Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 06/48] can: rcar_canfd: Update RCANFD_CFG_* macros Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 07/48] can: rcar_canfd: Simplify nominal bit rate config Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 08/48] can: rcar_canfd: Simplify data " Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 09/48] can: rcar_can: Consistently use ndev for net_device pointers Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 10/48] can: rcar_can: Add helper variable dev to rcar_can_probe() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 11/48] can: rcar_can: Convert to Runtime PM Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 12/48] can: rcar_can: Convert to BIT() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 13/48] can: rcar_can: Convert to GENMASK() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 14/48] can: rcar_can: CTLR bitfield conversion Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 15/48] can: rcar_can: TFCR " Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 16/48] can: rcar_can: BCR " Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 17/48] can: rcar_can: Mailbox " Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 18/48] can: rcar_can: Do not print alloc_candev() failures Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 19/48] can: rcar_can: Convert to %pe Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 20/48] can: esd_usb: Rework display of error messages Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 21/48] can: esd_usb: Avoid errors triggered from USB disconnect Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 22/48] can: raw: reorder struct uniqframe's members to optimise packing Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 23/48] can: raw: use bitfields to store flags in struct raw_sock Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 24/48] can: raw: reorder struct raw_sock's members to optimise packing Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 25/48] can: annotate mtu accesses with READ_ONCE() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 26/48] can: dev: turn can_set_static_ctrlmode() into a non-inline function Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 27/48] can: populate the minimum and maximum MTU values Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 28/48] can: enable CAN XL for virtual CAN devices by default Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 29/48] can: dev: move struct data_bittiming_params to linux/can/bittiming.h Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 30/48] can: dev: make can_get_relative_tdco() FD agnostic and move it to bittiming.h Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 31/48] can: netlink: document which symbols are FD specific Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 32/48] can: netlink: refactor can_validate_bittiming() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 33/48] can: netlink: add can_validate_tdc() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 34/48] can: netlink: add can_validate_databittiming() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 35/48] can: netlink: refactor CAN_CTRLMODE_TDC_{AUTO,MANUAL} flag reset logic Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 36/48] can: netlink: remove useless check in can_tdc_changelink() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 37/48] can: netlink: make can_tdc_changelink() FD agnostic Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 38/48] can: netlink: add can_dtb_changelink() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 39/48] can: netlink: add can_ctrlmode_changelink() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 40/48] can: netlink: make can_tdc_get_size() FD agnostic Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 41/48] can: netlink: add can_data_bittiming_get_size() Marc Kleine-Budde
2025-09-24  8:06 ` [PATCH net-next 42/48] can: netlink: add can_bittiming_fill_info() Marc Kleine-Budde
2025-09-24  8:07 ` [PATCH net-next 43/48] can: netlink: add can_bittiming_const_fill_info() Marc Kleine-Budde
2025-09-24  8:07 ` [PATCH net-next 44/48] can: netlink: add can_bitrate_const_fill_info() Marc Kleine-Budde
2025-09-24  8:07 ` [PATCH net-next 45/48] can: netlink: make can_tdc_fill_info() FD agnostic Marc Kleine-Budde
2025-09-24  8:07 ` [PATCH net-next 46/48] can: calc_bittiming: make can_calc_tdco() " Marc Kleine-Budde
2025-09-24  8:07 ` [PATCH net-next 47/48] can: dev: add can_get_ctrlmode_str() Marc Kleine-Budde
2025-09-24  8:07 ` [PATCH net-next 48/48] can: netlink: add userland error messages Marc Kleine-Budde
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]
2025-09-25 12:18 ` [PATCH net-next 0/48] pull-request: can-next 2025-09-24 Marc Kleine-Budde
2025-09-25 12:53   ` Stefan Mätje
2025-09-25 12:53     ` 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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.