[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e478c91f-28ec-e07a-6afd-0757ac72d1f3@stressinduktion.org>
Date: Wed, 18 May 2016 15:28:01 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Eric Dumazet <eric.dumazet@...il.com>,
Daniel Borkmann <daniel@...earbox.net>
Cc: davem@...emloft.net, alexei.starovoitov@...il.com,
netdev@...r.kernel.org
Subject: Re: [PATCH net] bpf: rather use get_random_int for randomizations
On 18.05.2016 15:20, Eric Dumazet wrote:
> On Wed, 2016-05-18 at 14:14 +0200, Daniel Borkmann wrote:
>> Start address randomization and blinding in BPF currently use
>> prandom_u32(). prandom_u32() values are not exposed to unpriviledged
>> user space to my knowledge, but given other kernel facilities such as
>> ASLR, stack canaries, etc make use of stronger get_random_int(), we
>> better make use of it here as well given blinding requests successively
>> new random values. get_random_int() has minimal entropy pool depletion,
>> is not cryptographically secure, but doesn't need to be for our use
>> cases here.
>
> Well, if it is not crypto secure, what is the point using it instead of
> prandom_u32() ?
Leaks of prandom_u32 allows an attacker to find the whole sequence of
generated random numbers or the other way around.
> I do not think changing this is fundamentally changing something, it
> looks like code churn or magic incantation to me.
I saw this during the review of the blinding patches. I was afraid, that
by extracting or dumping the ebpf program, a user could find out the
blinding constant and after some retries could find out the coefficients
to the taus rng, thus being able to infer the whole sequence generated
by prandom_u32.
> There is little amount of entropy since the hole is constrained by
> PAGE_SIZE.
True.
I don't consider this a big thing, I just mentioned that we probably
shouldn't use prandom_u32 if the value somehow could leak to user space
and should be used for security.
Bye,
Hannes
Powered by blists - more mailing lists