Re: [PATCH net v2] can: netlink: fix static FD-NON-ISO mode validation

From: Marc Kleine-Budde

Date: Wed Oct 21 2026 - 13:16:07 EST


On Sat, 05 Sep 2026 00:20:31 +0800, Zhu Ling <zhuling0805@xxxxxx> wrote:
> The static CAN_CTRLMODE_FD_NON_ISO mode does not have to be specified when
> CAN FD is disabled. Since commit 6742ca18cb41 ("can: netlink: add userland
> error messages"), ctrlstatic_missing is calculated before applying this
> exception. Disabling CAN FD on a controller with static FD-NON-ISO mode
> therefore fails with -EOPNOTSUPP.
>
> Apply the exception to ctrlstatic_missing instead of modifying ctrlstatic.
> Keep the original static mode mask and restore it after applying the
> userspace mask, so a request that disables CAN FD cannot remove
> CAN_CTRLMODE_FD_NON_ISO from priv->ctrlmode.
>
> [...]

Reviewed-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

--
Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>