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: <495BFB48.8080506@kernel.org>
Date:	Wed, 31 Dec 2008 15:07:52 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Matt Mackall <mpm@...enic.com>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...l.org>, Ingo Molnar <mingo@...e.hu>
Subject: Re: random.c changes for sparse irq_desc are crap

Matt Mackall wrote:
> I just noticed you merged a change that pointlessly converts two
> random.c functions into ugly random.h inlines without going through the
> maintainer.
> 
> I also don't like the look of the newly-introduced sparse variants of
> these functions. Failure to find an irq descriptor in
> get_timer_rand_state is a BUG_ON should-never-happen sort of condition,
> not something to silently ignore. Letting the code try to dereference
> NULL is preferred here: we'll actually be able to find and fix the
> broken driver that's throwing around meaningless irq vectors.
> 
> Throwing away the timer_state pointer in the set_timer_rand_state
> function is similarly bogus in addition to being a memory leak.
> 
> Please fix this up.
> 

want something like this?

---
 include/linux/random.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6/include/linux/random.h
===================================================================
--- linux-2.6.orig/include/linux/random.h
+++ linux-2.6/include/linux/random.h
@@ -75,8 +75,7 @@ static inline struct timer_rand_state *g
 
 	desc = irq_to_desc(irq);
 
-	if (!desc)
-		return NULL;
+	BUG_ON(!desc);
 
 	return desc->timer_rand_state;
 }
@@ -87,8 +86,7 @@ static inline void set_timer_rand_state(
 
 	desc = irq_to_desc(irq);
 
-	if (!desc)
-		return;
+	BUG_ON(!desc);
 
 	desc->timer_rand_state = state;
 }
--
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