From: netdev-bot+sashiko@kernel.org
To: mkl@pengutronix.de
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
linux-can@vger.kernel.org, kernel@pengutronix.de,
zhuling0805@qq.com, stable@vger.kernel.org,
socketcan@hartkopp.net, mailhol@kernel.org,
o.rempel@pengutronix.de
Subject: Re: [PATCH net 08/11] can: netlink: fix static FD-NON-ISO mode validation
Date: Wed, 18 Nov 2026 22:19:21 +0000 [thread overview]
Message-ID: <179504036152.3136.12444797036692057668@kernel.org> (raw)
In-Reply-To: <20261117220818.1142581-9-mkl@pengutronix.de>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The patch fixes a second, older bug but tags only the newer one.
--
can: netlink: fix static FD-NON-ISO mode validation
This patch moves the "fd is disabled" exception for the static FD-NON-ISO
mode in can_ctrlmode_changelink() from ctrlstatic to ctrlstatic_missing.
That stops requests such as 'fd off' or 'loopback on' from being rejected
on controllers with a static FD-NON-ISO mode. It also adds a check that
rejects any request which explicitly switches off a static control mode.
Link: https://lore.kernel.org/all/tencent_3A964832542399A780E646D6A6246335C409@qq.com/
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261115095746.709371-1-mkl%40pengutronix.de
Link: https://patch.msgid.link/20261117-can-bcmlock-memcg-v6-8-6826a6227d36@hartkopp.net
> diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c
> index 081dfddda0008..521e2496e2cc3 100644
> --- a/drivers/net/can/dev/netlink.c
> +++ b/drivers/net/can/dev/netlink.c
> @@ -330,9 +330,17 @@ static int can_ctrlmode_changelink(struct net_device *dev,
> return -EOPNOTSUPP;
> }
>
> + /* static control modes can not be switched off */
> + if (deactivated & ctrlstatic) {
> + NL_SET_ERR_MSG_FMT(extack,
> + "static control mode %s can not be switched off",
> + can_get_ctrlmode_str(deactivated & ctrlstatic));
> + return -EOPNOTSUPP;
> + }
[Severity: Low]
Should this patch also carry a Fixes: tag for commit c9e1d8ed304c ("can:
dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode()")?
The commit message says this check closes a bug that existed before
6742ca18cb41:
"before the above mentioned commit a request like 'fd-non-iso off'
passed the check and removed the static CAN_CTRLMODE_FD_NON_ISO bit
from priv->ctrlmode. As can_get_static_ctrlmode() derives the static
modes from priv->ctrlmode, this information was lost permanently."
The permanent loss comes from can_get_static_ctrlmode() in
include/linux/can/dev.h, which was added by c9e1d8ed304c (v5.17):
return priv->ctrlmode & ~priv->ctrlmode_supported;
Before c9e1d8ed304c, priv->ctrlmode_static was a separate field, so this
path could not clear it.
In trees that have c9e1d8ed304c but not 6742ca18cb41, take M_CAN v3.0.x or
v3.1.x, or pcan_usb_fd with firmware < 2.x. A request with
mask=FD_NON_ISO, flags=0 and FD not switched on passes the check. Then
'priv->ctrlmode &= ~cm->mask' clears the static bit. A later 'fd on' is
accepted and reported as ISO mode, while the hardware stays non-ISO.
The only tag is:
Fixes: 6742ca18cb41 ("can: netlink: add userland error messages")
With only that tag, will the stable tooling skip this fix for LTS trees
such as 6.1, 6.6 and 6.12? Those trees also lack ctrlstatic_missing, so
the patch would not apply there as is.
Would a second Fixes: c9e1d8ed304c tag help here? Or a note that older
trees need a separate backport?
> /* do not check for static fd-non-iso if 'fd' is disabled */
> if (!(maskedflags & CAN_CTRLMODE_FD))
> - ctrlstatic &= ~CAN_CTRLMODE_FD_NON_ISO;
> + ctrlstatic_missing &= ~CAN_CTRLMODE_FD_NON_ISO;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117220818.1142581-2-mkl%40pengutronix.de
next prev parent reply other threads:[~2026-11-18 22:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 22:03 [PATCH net 0/11] pull-request: can 2026-11-17 Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 01/11] can: bcm: copy the CAN frames outside of lock_sock() Marc Kleine-Budde
2026-11-17 22:12 ` netdev-bot+sinfo
2026-11-18 7:47 ` Oliver Hartkopp
2026-11-17 22:03 ` [PATCH net 02/11] can: bcm: do not remove the procfs entry in bcm_notify() Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 03/11] can: raw: use a private mutex instead of lock_sock() Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 04/11] can: isotp: " Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 05/11] can: bcm: " Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 06/11] can: isotp: always start the rx timeout in ISOTP_WAIT_DATA state Marc Kleine-Budde
2026-11-18 22:19 ` netdev-bot+sashiko
2026-11-17 22:03 ` [PATCH net 07/11] can: isotp: reject socket options while a transfer is active Marc Kleine-Budde
2026-11-18 22:19 ` netdev-bot+sashiko
2026-11-17 22:03 ` [PATCH net 08/11] can: netlink: fix static FD-NON-ISO mode validation Marc Kleine-Budde
2026-11-18 22:19 ` netdev-bot+sashiko [this message]
2026-11-17 22:03 ` [PATCH net 09/11] can: netlink: fix IFLA_CAN_BITRATE_MAX attribute sizing Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 10/11] can: netlink: fix CAN XL PWM " Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 11/11] can: gs_usb: gs_can_start_xmit(): don't leak uninitialized memory over USB 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=179504036152.3136.12444797036692057668@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=socketcan@hartkopp.net \
--cc=stable@vger.kernel.org \
--cc=zhuling0805@qq.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