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] [day] [month] [year] [list]
Message-ID: <20260118022803.1106110-1-kuba@kernel.org>
Date: Sat, 17 Jan 2026 18:28:03 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: anthony.l.nguyen@...el.com
Cc: Jakub Kicinski <kuba@...nel.org>,
	edumazet@...gle.com,
	davem@...emloft.net,
	aleksandr.loktionov@...el.com,
	netdev@...r.kernel.org,
	Samuel.salin@...el.com,
	pabeni@...hat.com,
	madhu.chittim@...el.com,
	andrew+netdev@...n.ch,
	milena.olech@...el.com,
	joshua.a.hay@...el.com
Subject: Re: [net-next,08/10] idpf: generalize send virtchnl message API

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
idpf: generalize send virtchnl message API

This patch changes virtchnl send message functions to take adapter and
vport_id instead of vport pointer, allowing these functions to be used
for configuring vport independent queues.

> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> index b937d93117c0..eb4654d3a1ff 100644

[ ... ]

> @@ -2831,8 +2844,9 @@ int idpf_send_get_stats_msg(struct idpf_vport *vport)
>
>  /**
>   * idpf_send_get_set_rss_lut_msg - Send virtchnl get or set RSS lut message
> - * @vport: virtual port data structure
> + * @adapter: adapter pointer used to send virtchnl message
>   * @rss_data: pointer to RSS key and lut info
> + * @vport_id: vport identifier used while preparing the virtchnl message
>   * @get: flag to set or get RSS look up table
>   *
>   * When rxhash is disabled, RSS LUT will be configured with zeros.  If rxhash
> @@ -2841,18 +2855,20 @@ int idpf_send_get_stats_msg(struct idpf_vport *vport)
>   *
>   * Return: 0 on success, negative on failure.
>   */
> -int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport,
> +int idpf_send_get_set_rss_lut_msg(struct idpf_adapter *adapter,
>  				  struct idpf_rss_data *rss_data,
> -				  bool get)
> +				  u32 vport_id, bool get)
>  {
>  	struct virtchnl2_rss_lut *recv_rl __free(kfree) = NULL;
>  	struct virtchnl2_rss_lut *rl __free(kfree) = NULL;
>  	struct idpf_vc_xn_params xn_params = {};
>  	int buf_size, lut_buf_size;
> +	struct idpf_vport *vport;
>  	ssize_t reply_sz;
>  	bool rxhash_ena;
>  	int i;
>
> +	vport = idpf_vid_to_vport(adapter, vport_id);
>  	rxhash_ena = idpf_is_feature_ena(vport, NETIF_F_RXHASH);

Can vport be NULL here? idpf_vid_to_vport() returns NULL if it cannot
find a matching vport_id, but idpf_is_feature_ena() dereferences
vport->netdev without a NULL check.

Other callers of idpf_vid_to_vport() in this file do check for NULL:

  idpf_mac_filter_async_handler():
      vport = idpf_vid_to_vport(adapter, le32_to_cpu(ma_list->vport_id));
      if (!vport)
          goto invalid_payload;

  idpf_handle_event_link():
      vport = idpf_vid_to_vport(adapter, le32_to_cpu(v2e->vport_id));
      if (!vport) {
          dev_err_ratelimited(...);
          return;
      }

Should there be a similar NULL check before calling idpf_is_feature_ena()?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ