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, 19 May 2009 11:08:38 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Martin Knoblauch <spamtrap@...bisoft.de>
cc:	Matt Mackall <mpm@...enic.com>, Ingo Molnar <mingo@...e.hu>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Rgeression: 2.6.30-rc6-git3 build error - ICE from
 drivers/char/random.c



On Tue, 19 May 2009, Martin Knoblauch wrote:
> > 
> > Ok, so can you do two other simple tests:
> > 
> > - just remove the  "+ (long)&ret" entirely.
> > 
> >    Now, usually gcc doesn't have issues with non-asm things, but that's an 
> >    odd way of getting the current stack address by lookin gat the address 
> >    of a variable that hasn't even been used, so maybe it triggers some 
> >    untested codepath in gcc (and thus the bug).
> > 
> 
>  Removing above fixes the ICE. It does so in both the original and the patched version. 
> 
>  Removing get_cycles() has no effect wrt. the ICE.

Oh wow. Ok, I suggested it, but I have to admit that I didn't really think 
that it would be the &ret thing.

Very interesting fragility in your gcc version.

Anyway, that part of the garbage is much less interesting than the cycle 
counter (the stack pointer will be the same for the same process and 
callchain anyway - and 'current->pid' is already gives difference answers 
for different processes), so I'll just remove it.

We could replace it with something like __builtin_frame_address(0) or 
whatever, but I don't know which gcc version _that_ was introduced in, so 
I suspect I should just get rid of it as not being worth it.

I guess getting rid of 'jiffies' is also worth it. Even at its very worst, 
'get_cycles()' should return jiffy-level information, so adding in jiffies 
doesn't add anything to it.

So I'll just commit this. But I'd like to have a final "tested-by" from 
you, since I don't have access to your version of gcc on any of my 
machines.

		Linus
---
 drivers/char/random.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index b2ced39..b361f45 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1673,7 +1673,7 @@ unsigned int get_random_int(void)
 	int ret;
 
 	keyptr = get_keyptr();
-	hash[0] += current->pid + jiffies + get_cycles() + (int)(long)&ret;
+	hash[0] += current->pid + get_cycles();
 
 	ret = half_md4_transform(hash, keyptr->secret);
 	put_cpu_var(get_random_int_hash);
--
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