[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130924023038.GA22393@order.stressinduktion.org>
Date: Tue, 24 Sep 2013 04:30:38 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Tom Herbert <therbert@...gle.com>, davem@...emloft.net,
netdev@...r.kernel.org, jesse.brandeburg@...el.com
Subject: Re: [PATCH 1/2] net: Toeplitz library functions
On Mon, Sep 23, 2013 at 05:03:11PM -0700, Eric Dumazet wrote:
> On Mon, 2013-09-23 at 15:41 -0700, Tom Herbert wrote:
>
> > +#ifdef CONFIG_NET_TOEPLITZ
> > + toeplitz_net = toeplitz_alloc();
> > + if (!toeplitz_net)
> > + goto out;
> > +
> > + toeplitz_init(toeplitz_net, NULL);
> > +#endif
> > +
>
> Hmm
>
> 1) Security alert here.
>
> Many devices (lets say Android phones) have no entropy at this point,
> all devices will have same toeplitz key.
>
> Check build_ehash_secret() for a possible point for the feeding of the
> key. (and commit 08dcdbf6a7b9d14c2302c5bd0c5390ddf122f664 )
>
> If hardware toeplitz is ever used, we want to make sure every host uses
> a private and hidden Toeplitz key.
I just had a look at it myself and have one question:
ipv6/af_inet6.c:
112 if (sock->type != SOCK_RAW &&
113 sock->type != SOCK_DGRAM &&
114 !inet_ehash_secret)
115 build_ehash_secret();
ipv4/af_inet.c:
289 if (unlikely(!inet_ehash_secret))
290 if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM)
291 build_ehash_secret();
Why do we care about the sock->type?
build_ehash_secret builds up the data which seeds fragmentation ids, ephermal
port randomization etc. Could we drop the check of sock->type? I guess the
idea was that in-kernel sockets of type raw/udp do not seed the keys when no
entropy is available?
Thanks,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists