From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodore Ts'o Subject: Re: [PATCH] random: seed random_int_secret at least poorly at core_initcall time Date: Wed, 13 Nov 2013 21:54:48 -0500 Message-ID: <20131114025448.GB31602@thunk.org> References: <2ea03f60bb65429cbe5d74a6d356fde3eefcf06c.1384160397.git.dborkman@redhat.com> <20131111134357.GC10104@thunk.org> <20131112000307.GB14929@order.stressinduktion.org> <20131112115350.GA14077@thunk.org> <20131112131627.GD14929@order.stressinduktion.org> <20131112134603.GE14929@order.stressinduktion.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Daniel Borkmann , davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, shemminger-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org, fweimer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Eric Dumazet , linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org Return-path: Content-Disposition: inline In-Reply-To: <20131112134603.GE14929-5j1vdhnGyZutBveJljeh2VPnkB77EeZ12LY78lusg7I@public.gmane.org> Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Tue, Nov 12, 2013 at 02:46:03PM +0100, Hannes Frederic Sowa wrote: > > It is needed by fork to set up the stack canary. And this actually gets > > called before the secret is initialized. > > Maybe we could use this for the time being and use the seeding method > of kaslr as soon as it hits the tree? Hmm, from what I can tell even early_initcall() is going to be early enough. The stack canary is set up by boot_init_stack_canary(), which is run very, very early in start_kerne() --- way before early_initcalls, or even before interrupts are enabled. So adding random_int_secret_init_early() as a core_initcall is still too late. I wonder if we need to do something in common with what Kees has been considering for the kaslr code, since it's a similar issue --- we need random number way earlier than we can really afford to initialize /dev/random. - Ted P.S. Unless I'm missing something (and I hope I am), it would appear that the stack canary is going to easily predictable by an attacker on non-x86 platforms that don't have RDRAND. Has someone tested whether or not the stack canary isn't constant across ARM or pre-Sandy Bridge x86 systems? -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html