lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZ6Rq+10m=yQ9Cc9gZQegwD=6iCU=s1r78+ogJ4PV0f5_s+tQ@mail.gmail.com>
Date:   Tue, 7 Nov 2023 11:26:42 +0900
From:   Vincent MAILHOL <mailhol.vincent@...adoo.fr>
To:     Maxime Jayat <maxime.jayat@...ile-devices.fr>
Cc:     Wolfgang Grandegger <wg@...ndegger.com>,
        Marc Kleine-Budde <mkl@...gutronix.de>,
        linux-can@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] can: netlink: Fix TDCO calculation using the old data bittiming

On Tue. 7 Nov. 2023 at 03:02, Maxime Jayat
<maxime.jayat@...ile-devices.fr> wrote:
> The TDCO calculation was done using the currently applied data bittiming,
> instead of the newly computed data bittiming, which means that the TDCO
> had an invalid value unless setting the same data bittiming twice.

Nice catch!

Moving the can_calc_tdco() before the memcpy(&priv->data_bittiming,
&dbt, sizeof(dbt)) was one of the last changes I made. And the last
batch of tests did not catch that. Thanks for the patch!

> Fixes: d99755f71a80 ("can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC)")
> Signed-off-by: Maxime Jayat <maxime.jayat@...ile-devices.fr>

Reviewed-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>

> ---
>  drivers/net/can/dev/netlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c
> index 036d85ef07f5..dfdc039d92a6 100644
> --- a/drivers/net/can/dev/netlink.c
> +++ b/drivers/net/can/dev/netlink.c
> @@ -346,7 +346,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
>                         /* Neither of TDC parameters nor TDC flags are
>                          * provided: do calculation
>                          */
> -                       can_calc_tdco(&priv->tdc, priv->tdc_const, &priv->data_bittiming,
> +                       can_calc_tdco(&priv->tdc, priv->tdc_const, &dbt,
>                                       &priv->ctrlmode, priv->ctrlmode_supported);
>                 } /* else: both CAN_CTRLMODE_TDC_{AUTO,MANUAL} are explicitly
>                    * turned off. TDC is disabled: do nothing
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ