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:	Fri, 23 Jul 2010 13:32:46 -0400
From:	"John W. Linville" <linville@...driver.com>
To:	"Mario 'BitKoenig' Holbe" <Mario.Holbe@...Ilmenau.DE>,
	linux-kernel@...r.kernel.org
Subject: Re: b43 wireless driver inhibits access to /dev/hwrng

On Fri, Jul 23, 2010 at 05:31:02PM +0200, Mario 'BitKoenig' Holbe wrote:
> On Fri, Jul 23, 2010 at 10:32:19AM -0400, John W. Linville wrote:
> > The hwrng driver is provided by the b43 hardware, which is shutdown
> > when the network interface is down.  I'm not sure how one could expect
> > this to work.
> 
> Nope. It's provided by the VIA PadLock hardware (through the via-rng
> driver). I'm not sure how one could expect this not to work when the
> network interface provided by the b43 driver is down.

Alright, sorry I overlooked that.  Although it still looks to me like
your current_rng must be the b43-provided one, or else you wouldn't
be experiencing this issue.

> Well, maybe let's try to become a bit less offensive... :)
> Probably there are two Hardware RNGs on that machine: one provided by
> VIA PadLock through via-rng, one provided by BCM4312 through b43:
> 	hw_random/via-rng.c:    err = hwrng_register(&via_rng);
> 	b43/main.c: err = hwrng_register(&wl->rng);
> 
> But at least now it's a bit more likely that the problem is located in
> the rng core which should not render /dev/hwrng inaccessible when only
> one of the RNGs unregisters.
> 
> However, what I don't fully understand is: I find only one way where b43
> unregisters its RNG, which is via
> 	b43_remove() -> b43_rng_exit() -> hwrng_unregister()
> And, I'm really not sure if I got this right, but... I guess,
> b43_remove() is only called when the module is removed from the kernel
> and not when the network interface is shut down.
> 
> So, maybe it's not really rng core's fault?
> I guess, b43 just stops delivering data through b43_rng_read() when the
> hardware is shut down and instead returns ENODEV (which is btw. what I
> get when I'm trying to read /dev/hwrng while b43 is down), and the rng
> core just delivers this error up when it's trying to deliver the read
> request to the b43 RNG.

Yes, I believe this is what the b43 hwrng is doing.  I suspect you
need/want a way to influence current_rng to favor via-rng.  You may
want to reference Documentation/hw_random.txt for further information.

Good luck!

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@...driver.com			might be all we have.  Be ready.
--
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