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: <20220613.115058.818063822562949798.davem@davemloft.net>
Date:   Mon, 13 Jun 2022 11:50:58 +0100 (BST)
From:   David Miller <davem@...emloft.net>
To:     longli@...rosoft.com, longli@...uxonhyperv.com
Cc:     kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
        wei.liu@...nel.org, decui@...rosoft.com, kuba@...nel.org,
        pabeni@...hat.com, jgg@...pe.ca, leon@...nel.org,
        edumazet@...gle.com, shiraz.saleem@...el.com,
        sharmaajay@...rosoft.com, linux-hyperv@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-rdma@...r.kernel.org
Subject: Re: [Patch v3 03/12] net: mana: Handle vport sharing between
 devices

From: longli@...uxonhyperv.com
Date: Sun, 12 Jun 2022 14:14:45 -0700

> +int mana_cfg_vport(struct mana_port_context *apc, u32 protection_dom_id,
> +		   u32 doorbell_pg_id)
>  {
> +	/* Ethernet driver and IB driver can't take the port at the same time */
> +	refcount_inc(&apc->port_use_count);
> +	if (refcount_read(&apc->port_use_count) > 2) {

This is a racy test, the count could change after the test against
'2'.  It would be nice if there was a primitive to do the increment
and test atomically, but I fail to see one that matches this scenerio
currently.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ