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: <20140324.152945.1082990562317636743.davem@davemloft.net>
Date:	Mon, 24 Mar 2014 15:29:45 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	wei.liu2@...rix.com
Cc:	netdev@...r.kernel.org, xen-devel@...ts.xen.org,
	paul.durrant@...rix.com, zoltan.kiss@...rix.com, edwin@...rok.net,
	ian.campbell@...rix.com
Subject: Re: [PATCH net] xen-netback: disable rogue vif in kthread context

From: Wei Liu <wei.liu2@...rix.com>
Date: Mon, 24 Mar 2014 12:13:34 +0000

> @@ -62,6 +62,13 @@ static int xenvif_poll(struct napi_struct *napi, int budget)
>  	struct xenvif *vif = container_of(napi, struct xenvif, napi);
>  	int work_done;
>  
> +	/* This vif is rogue, we pretend we've used up all budget to
> +	 * deschedule it from NAPI. But this interface will be turned
> +	 * off in thread context later.
> +	 */
> +	if (unlikely(vif->disabled))
> +		return budget;
> +

As mentioned by others, this makes NAPI poll forever.

The following comment was referenced:

		/* Drivers must not modify the NAPI state if they
		 * consume the entire weight.  In such cases this code
		 * still "owns" the NAPI instance and therefore can
		 * move the instance around on the list at-will.
		 */
		if (unlikely(work == weight)) {

WHICH MEANS, if you return that you used the full budget, the NAPI instance
is still owned by the core.

Why?  Becuase if you used the entire budget, it's going to put you back onto
the polling list and invoke you again some time soon.

If the interface is disabled, you should return zero from the poll and do a
NAPI completion.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ