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>] [day] [month] [year] [list]
Message-Id: <200803081110.52126.mitov@issp.bas.bg>
Date:	Sat, 8 Mar 2008 11:10:51 +0200
From:	Marin Mitov <mitov@...p.bas.bg>
To:	linux-kernel@...r.kernel.org
Cc:	Jeff Garzik <jgarzik@...ox.com>
Subject: guard against buggy poll() return value

Hi all,

Looking in net/core/dev.c I see:

WARN_ON_ONCE(work > weight);

which is a guard against buggy net drivers returning
more work from their poll method than they should.

Few lines bellow a check is done:

if (unlikely(work == weight)) 

which excludes the buggy outcome. 
Should not it be changed to:

if (unlikely(work >= weight)) 

If you find it worth, here is a patch against 2.6.24.3.

Regards.

Marin Mitov

Signed-off-by: Marin Mitov <mitov@...p.bas.bg>
-------------------------------------------
--- a/net/core/dev.c	2008-03-08 10:37:50.000000000 +0200
+++ b/net/core/dev.c	2008-03-08 10:39:09.000000000 +0200
@@ -2207,7 +2207,7 @@ static void net_rx_action(struct softirq
 		 * still "owns" the NAPI instance and therefore can
 		 * move the instance around on the list at-will.
 		 */
-		if (unlikely(work == weight)) {
+		if (unlikely(work >= weight)) {
 			if (unlikely(napi_disable_pending(n)))
 				__napi_complete(n);
 			else

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ