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: <a5366506-2083-4957-b269-71e0a343be10@redhat.com>
Date: Tue, 11 Mar 2025 15:55:20 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Xin Tian <tianx@...silicon.com>, netdev@...r.kernel.org
Cc: leon@...nel.org, andrew+netdev@...n.ch, kuba@...nel.org,
 edumazet@...gle.com, davem@...emloft.net, jeff.johnson@....qualcomm.com,
 przemyslaw.kitszel@...el.com, weihg@...silicon.com, wanry@...silicon.com,
 jacky@...silicon.com, horms@...nel.org, parthiban.veerasooran@...rochip.com,
 masahiroy@...nel.org, kalesh-anakkur.purayil@...adcom.com,
 geert+renesas@...der.be
Subject: Re: [PATCH net-next v8 02/14] xsc: Enable command queue

On 3/7/25 11:08 AM, Xin Tian wrote:
> +void xsc_cmd_use_events(struct xsc_core_device *xdev)
> +{
> +	struct xsc_cmd *cmd = &xdev->cmd;
> +	int i;
> +
> +	for (i = 0; i < cmd->max_reg_cmds; i++)
> +		down(&cmd->sem);
> +
> +	flush_workqueue(cmd->wq);
> +
> +	cmd->mode = XSC_CMD_MODE_EVENTS;
> +
> +	while (cmd->cmd_pid != cmd->cq_cid)

If I read correctly, `cq_cid` can be concurrently and locklessy modfied
by xsc_cmd_resp_handler() and/or xsc_cmd_cq_polling().

If so you need at least READ/WRITE_ONCE() annotations and possibly some
explicit mutual exclusion between xsc_cmd_resp_handler and
xsc_cmd_cq_polling.

Thanks,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ