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: <20250724133446.GM1150792@horms.kernel.org>
Date: Thu, 24 Jul 2025 14:34:46 +0100
From: Simon Horman <horms@...nel.org>
To: Daniel Zahka <daniel.zahka@...il.com>
Cc: Donald Hunter <donald.hunter@...il.com>,
	Jakub Kicinski <kuba@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Jonathan Corbet <corbet@....net>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Saeed Mahameed <saeedm@...dia.com>,
	Leon Romanovsky <leon@...nel.org>, Tariq Toukan <tariqt@...dia.com>,
	Boris Pismenny <borisp@...dia.com>,
	Kuniyuki Iwashima <kuniyu@...gle.com>,
	Willem de Bruijn <willemb@...gle.com>,
	David Ahern <dsahern@...nel.org>,
	Neal Cardwell <ncardwell@...gle.com>,
	Patrisious Haddad <phaddad@...dia.com>,
	Raed Salem <raeds@...dia.com>, Jianbo Liu <jianbol@...dia.com>,
	Dragos Tatulea <dtatulea@...dia.com>,
	Rahul Rameshbabu <rrameshbabu@...dia.com>,
	Stanislav Fomichev <sdf@...ichev.me>,
	Toke Høiland-Jørgensen <toke@...hat.com>,
	Alexander Lobakin <aleksander.lobakin@...el.com>,
	Jacob Keller <jacob.e.keller@...el.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v5.0 15/19] net/mlx5e: Add PSP steering in local
 NIC RX

On Wed, Jul 23, 2025 at 01:34:46PM -0700, Daniel Zahka wrote:
> From: Raed Salem <raeds@...dia.com>
> 
> Introduce decrypt FT, the RX error FT, and the default rules.
> 
> The PSP (PSP) RX decrypt flow table is pointed by the TTC
> (Traffic Type Classifier) UDP steering rules.
> The decrypt flow table has two flow groups. The first flow group
> keeps the decrypt steering rule programmed always when PSP packet is
> recognized using the dedicated udp destination port number 1000, if
> packet is decrypted then a PSP marker is set in metadata_regB[30].
> The second flow group has a default rule to forward all non-offloaded
> PSP packet to the TTC UDP default RSS TIR.
> 
> The RX error flow table is the destination of the decrypt steering rules in
> the PSP RX decrypt flow table. It has two fixed rule one with single copy
> action that copies psp_syndrome to metadata_regB[23:29]. The PSP marker
> and syndrome is used to filter out non-psp packet and to return the PSP
> crypto offload status in Rx flow. The marker is used to identify such
> packet in driver so the driver could set SKB PSP metadata. The destination
> of RX error flow table is the TTC UDP default RSS TIR. The second rule will
> drop packets that failed to be decrypted (like in case illegal SPI or
> expired SPI is used).
> 
> Signed-off-by: Raed Salem <raeds@...dia.com>
> Signed-off-by: Rahul Rameshbabu <rrameshbabu@...dia.com>
> Signed-off-by: Cosmin Ratiu <cratiu@...dia.com>
> Signed-off-by: Daniel Zahka <daniel.zahka@...il.com>

...

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_fs.c

> +static int accel_psp_fs_rx_ft_get(struct mlx5e_psp_fs *fs, enum accel_fs_psp_type type)
> +{
> +	struct mlx5_ttc_table *ttc = mlx5e_fs_get_ttc(fs->fs, false);

Below it is assumed that fs may be NULL.
But above it is dereference unconditionally.
This does not seem consistent.

> +	struct mlx5e_accel_fs_psp_prot *fs_prot;
> +	struct mlx5_flow_destination dest = {};
> +	struct mlx5e_accel_fs_psp *accel_psp;
> +	int err = 0;
> +
> +	if (!fs || !fs->rx_fs)
> +		return -EINVAL;
> +
> +	accel_psp = fs->rx_fs;
> +	fs_prot = &accel_psp->fs_prot[type];
> +	mutex_lock(&fs_prot->prot_mutex);
> +	if (fs_prot->refcnt++)
> +		goto out;
> +
> +	/* create FT */
> +	err = accel_psp_fs_rx_create(fs, type);
> +	if (err) {
> +		fs_prot->refcnt--;
> +		goto out;
> +	}
> +
> +	/* connect */
> +	dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
> +	dest.ft = fs_prot->ft;
> +	mlx5_ttc_fwd_dest(ttc, fs_psp2tt(type), &dest);
> +
> +out:
> +	mutex_unlock(&fs_prot->prot_mutex);
> +	return err;
> +}

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ