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]
Date:   Fri, 13 Aug 2021 17:46:55 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Alex Elder <elder@...aro.org>
Cc:     davem@...emloft.net, bjorn.andersson@...aro.org,
        evgreen@...omium.org, cpratapa@...eaurora.org,
        subashab@...eaurora.org, elder@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 4/6] net: ipa: ensure hardware has power in
 ipa_start_xmit()

On Thu, 12 Aug 2021 14:50:33 -0500 Alex Elder wrote:
> +	/* The hardware must be powered for us to transmit */
> +	dev = &ipa->pdev->dev;
> +	ret = pm_runtime_get(dev);
> +	if (ret < 1) {
> +		/* If a resume won't happen, just drop the packet */
> +		if (ret < 0 && ret != -EINPROGRESS) {
> +			pm_runtime_put_noidle(dev);
> +			goto err_drop_skb;
> +		}

This is racy, what if the pm work gets scheduled on another CPU and
calls wake right here (i.e. before you call netif_stop_queue())?
The queue may never get woken up?

> +		/* No power (yet).  Stop the network stack from transmitting
> +		 * until we're resumed; ipa_modem_resume() arranges for the
> +		 * TX queue to be started again.
> +		 */
> +		netif_stop_queue(netdev);
> +
> +		(void)pm_runtime_put(dev);
> +
> +		return NETDEV_TX_BUSY;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ