Netdev List
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Jakub Kicinski <kuba@kernel.org>, davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org, danieller@nvidia.com,
	petrm@nvidia.com, o.rempel@pengutronix.de, idosch@nvidia.com,
	andrew@lunn.ch
Subject: Re: [PATCH net 7/9] ethtool: cmis: fix u16-to-u8 truncation of msleep_pre_rpl
Date: Sat, 23 May 2026 16:53:47 +0200	[thread overview]
Message-ID: <b02fc4d9-2430-459c-82de-c3abbea798fb@bootlin.com> (raw)
In-Reply-To: <20260522231312.1710836-8-kuba@kernel.org>

Hi,

On 5/23/26 01:13, Jakub Kicinski wrote:
> ethtool_cmis_cdb_compose_args() accepts msleep_pre_rpl as u16 but stores
> it into the u8 field ethtool_cmis_cdb_cmd_args::msleep_pre_rpl, silently
> truncating values >= 256. Seven of the nine call sites pass 1000 ms
> (it's the third argument from the end).
> 
> Fixes: a39c84d79625 ("ethtool: cmis_cdb: Add a layer for supporting CDB commands")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime

> ---
> CC: andrew@lunn.ch
> CC: petrm@nvidia.com
> CC: danieller@nvidia.com
> ---
>   net/ethtool/cmis.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ethtool/cmis.h b/net/ethtool/cmis.h
> index 4a9a946cabf0..778783a0f23c 100644
> --- a/net/ethtool/cmis.h
> +++ b/net/ethtool/cmis.h
> @@ -63,9 +63,9 @@ struct ethtool_cmis_cdb_request {
>    * struct ethtool_cmis_cdb_cmd_args - CDB commands execution arguments
>    * @req: CDB command fields as described in the CMIS standard.
>    * @max_duration: Maximum duration time for command completion in msec.
> + * @msleep_pre_rpl: Waiting time before checking reply in msec.
>    * @read_write_len_ext: Allowable additional number of byte octets to the LPL
>    *			in a READ or a WRITE commands.
> - * @msleep_pre_rpl: Waiting time before checking reply in msec.
>    * @rpl_exp_len: Expected reply length in bytes.
>    * @flags: Validation flags for CDB commands.
>    * @err_msg: Error message to be sent to user space.
> @@ -73,8 +73,8 @@ struct ethtool_cmis_cdb_request {
>   struct ethtool_cmis_cdb_cmd_args {
>   	struct ethtool_cmis_cdb_request req;
>   	u16				max_duration;
> +	u16				msleep_pre_rpl;
>   	u8				read_write_len_ext;
> -	u8				msleep_pre_rpl;
>   	u8                              rpl_exp_len;
>   	u8				flags;
>   	char				*err_msg;


  reply	other threads:[~2026-05-23 14:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 23:13 [PATCH net 0/9] ethtool: module: fix a handful of small bugs Jakub Kicinski
2026-05-22 23:13 ` [PATCH net 1/9] ethtool: module: call ethnl_ops_complete() on module flash errors Jakub Kicinski
2026-05-23 14:28   ` Maxime Chevallier
2026-05-22 23:13 ` [PATCH net 2/9] ethtool: module: avoid leaking a netdev ref " Jakub Kicinski
2026-05-23 14:32   ` Maxime Chevallier
2026-05-22 23:13 ` [PATCH net 3/9] ethtool: module: avoid racy updates to dev->ethtool bitfield Jakub Kicinski
2026-05-23 14:38   ` Maxime Chevallier
2026-05-22 23:13 ` [PATCH net 4/9] ethtool: module: check fw_flash_in_progress under rtnl_lock Jakub Kicinski
2026-05-23 14:40   ` Maxime Chevallier
2026-05-22 23:13 ` [PATCH net 5/9] ethtool: module: fix cleanup if socket used for flashing multiple devices Jakub Kicinski
2026-05-22 23:13 ` [PATCH net 6/9] ethtool: cmis: require exact CDB reply length Jakub Kicinski
2026-05-22 23:13 ` [PATCH net 7/9] ethtool: cmis: fix u16-to-u8 truncation of msleep_pre_rpl Jakub Kicinski
2026-05-23 14:53   ` Maxime Chevallier [this message]
2026-05-22 23:13 ` [PATCH net 8/9] ethtool: cmis: validate start_cmd_payload_size from module Jakub Kicinski
2026-05-23 14:56   ` Maxime Chevallier
2026-05-22 23:13 ` [PATCH net 9/9] ethtool: cmis: validate fw->size against start_cmd_payload_size Jakub Kicinski
2026-05-23 14:59   ` Maxime Chevallier

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=b02fc4d9-2430-459c-82de-c3abbea798fb@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.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