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:	Tue, 29 Nov 2011 10:48:54 +0100
From:	"Igor Maravić" <igorm@....rs>
To:	"Eric Dumazet" <eric.dumazet@...il.com>
Cc:	igorm@....rs, netdev@...r.kernel.org
Subject: Re: [PATCH 1/1] netstamp_needed shouldn't be jump_label_key

> Its better to have coverage of the test, even on machines with no
> HAVE_JUMP_LABEL.
>
> So move the test before the
> #ifdef HAVE_JUMP_LABEL
>

Here is it.

PS. Tested the patch - it works.

[PATCH 1/1] Warning if_interrupt is true

Move warning on the top of function net_enable_timestamp,
so we would be also warn if we are going to use jump_label_dec in interrupt

Signed-off-by: Igor Maravic <igorm@....rs>

:100644 100644 45eab03... d358088... M	net/core/dev.c

diff --git a/net/core/dev.c b/net/core/dev.c
index 45eab03..d358088 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1451,16 +1451,18 @@ static atomic_t netstamp_needed_deferred;

 void net_enable_timestamp(void)
 {
+	WARN_ON(in_interrupt());
 #ifdef HAVE_JUMP_LABEL
-	int deferred = atomic_xchg(&netstamp_needed_deferred, 0);
-
-	if (deferred) {
-		while (--deferred)
-			jump_label_dec(&netstamp_needed);
-		return;
+	{
+		int deferred = atomic_xchg(&netstamp_needed_deferred, 0);
+
+		if (deferred) {
+			while (--deferred)
+				jump_label_dec(&netstamp_needed);
+			return;
+		}
 	}
 #endif
-	WARN_ON(in_interrupt());
 	jump_label_inc(&netstamp_needed);
 }
 EXPORT_SYMBOL(net_enable_timestamp);
-- 
1.7.5.4


--
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