* Introduce support to lazy initialize mostly static keys
@ 2013-09-26 23:16 Hannes Frederic Sowa
2013-09-26 23:30 ` Hannes Frederic Sowa
[not found] ` <1380236199-3726-4-git-send-email-hannes@stressinduktion.org>
0 siblings, 2 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2013-09-26 23:16 UTC (permalink / raw)
To: netdev; +Cc: edumazet, davem, fw, ycheng
Hi!
This series implements support for delaying the initialization of secret
keys, e.g. used for hashing, for as long as possible. This functionality
is implemented by a new macro, net_get_random_bytes.
I already used it to protect the socket hashes, the syncookie secret
(most important) and the tcp_fastopen secrets.
This series depends on a patch from Eric Dumazet (already in patchworks):
"net: net_secret should not depend on TCP"
Included patches:
ipv4: split inet_ehashfn to one hash
ipv6: split inet6_ehashfn to one hash
net: introduce new macro net_get_random_once
inet: split syncookie keys for ipv4 and ipv6 and
inet: convert inet_ehash_secret and
tcp: switch tcp_fastopen key generation to
net: switch net_secret key generation to
Diffstat:
include/linux/net.h | 14 ++++++++++++++
include/net/inet6_hashtables.h | 29 +++++++----------------------
include/net/inet_sock.h | 26 ++++++--------------------
include/net/ipv6.h | 4 ++--
include/net/tcp.h | 3 +--
net/core/secure_seq.c | 14 ++------------
net/core/utils.c | 21 +++++++++++++++++++++
net/ipv4/af_inet.c | 27 ---------------------------
net/ipv4/inet_hashtables.c | 25 +++++++++++++++++++++++++
net/ipv4/syncookies.c | 15 +++++----------
net/ipv4/sysctl_net_ipv4.c | 5 +++++
net/ipv4/tcp_fastopen.c | 21 ++++++++++-----------
net/ipv4/udp.c | 22 +++++++++++++++++-----
net/ipv6/af_inet6.c | 5 -----
net/ipv6/inet6_hashtables.c | 40 +++++++++++++++++++++++++++++++++++++---
net/ipv6/syncookies.c | 12 +++++++++---
net/ipv6/udp.c | 37 ++++++++++++++++++++++++++++++-------
net/rds/connection.c | 18 ++++++++++++------
18 files changed, 203 insertions(+), 135 deletions(-)
Greetings,
Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Introduce support to lazy initialize mostly static keys
2013-09-26 23:16 Introduce support to lazy initialize mostly static keys Hannes Frederic Sowa
@ 2013-09-26 23:30 ` Hannes Frederic Sowa
[not found] ` <1380236199-3726-4-git-send-email-hannes@stressinduktion.org>
1 sibling, 0 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2013-09-26 23:30 UTC (permalink / raw)
To: netdev, edumazet, davem, fw, ycheng
On Fri, Sep 27, 2013 at 01:16:57AM +0200, Hannes Frederic Sowa wrote:
> This series implements support for delaying the initialization of secret
> keys, e.g. used for hashing, for as long as possible. This functionality
> is implemented by a new macro, net_get_random_bytes.
>
> I already used it to protect the socket hashes, the syncookie secret
> (most important) and the tcp_fastopen secrets.
>
> This series depends on a patch from Eric Dumazet (already in patchworks):
> "net: net_secret should not depend on TCP"
Oh, sorry. My tunnel was not working. Mails hit a strange fallback. Will
resend shortly.
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <1380236199-3726-4-git-send-email-hannes@stressinduktion.org>]
* Re: [PATCH net-next 3/7] net: introduce new macro net_get_random_once
[not found] ` <1380236199-3726-4-git-send-email-hannes@stressinduktion.org>
@ 2013-09-30 19:43 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-09-30 19:43 UTC (permalink / raw)
To: hannes; +Cc: netdev, edumazet
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Fri, 27 Sep 2013 00:56:35 +0200
> +/* BE CAREFUL: this function is not interrupt safe */
> +#define net_get_random_once(buf, nbytes) \
> + ({ \
> + static bool ___done = false; \
> + bool ___ret = false; \
> + if (unlikely(!___done)) \
> + ___ret = __net_get_random_once(buf, \
> + nbytes, \
> + &___done); \
> + ___ret; \
> + })
I don't want to see this happening in every fast path, it's silly to test
this every time after the first iteration.
Maybe... _maybe_ I can be convinced if you use a static branch for this so
that it _really_ costs next to nothing.
But as-is I am not going to apply this series, sorry.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Introduce support to lazy initialize mostly static keys
@ 2013-09-26 23:32 Hannes Frederic Sowa
0 siblings, 0 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2013-09-26 23:32 UTC (permalink / raw)
To: netdev
Hi!
This series implements support for delaying the initialization of secret
keys, e.g. used for hashing, for as long as possible. This functionality
is implemented by a new macro, net_get_random_bytes.
I already used it to protect the socket hashes, the syncookie secret
(most important) and the tcp_fastopen secrets.
This series depends on a patch from Eric Dumazet (already in patchworks):
"net: net_secret should not depend on TCP"
Included patches:
ipv4: split inet_ehashfn to one hash
ipv6: split inet6_ehashfn to one hash
net: introduce new macro net_get_random_once
inet: split syncookie keys for ipv4 and ipv6 and
inet: convert inet_ehash_secret and
tcp: switch tcp_fastopen key generation to
net: switch net_secret key generation to
Diffstat:
include/linux/net.h | 14 ++++++++++++++
include/net/inet6_hashtables.h | 29 +++++++----------------------
include/net/inet_sock.h | 26 ++++++--------------------
include/net/ipv6.h | 4 ++--
include/net/tcp.h | 3 +--
net/core/secure_seq.c | 14 ++------------
net/core/utils.c | 21 +++++++++++++++++++++
net/ipv4/af_inet.c | 27 ---------------------------
net/ipv4/inet_hashtables.c | 25 +++++++++++++++++++++++++
net/ipv4/syncookies.c | 15 +++++----------
net/ipv4/sysctl_net_ipv4.c | 5 +++++
net/ipv4/tcp_fastopen.c | 21 ++++++++++-----------
net/ipv4/udp.c | 22 +++++++++++++++++-----
net/ipv6/af_inet6.c | 5 -----
net/ipv6/inet6_hashtables.c | 40 +++++++++++++++++++++++++++++++++++++---
net/ipv6/syncookies.c | 12 +++++++++---
net/ipv6/udp.c | 37 ++++++++++++++++++++++++++++++-------
net/rds/connection.c | 18 ++++++++++++------
18 files changed, 203 insertions(+), 135 deletions(-)
Greetings,
Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-30 19:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26 23:16 Introduce support to lazy initialize mostly static keys Hannes Frederic Sowa
2013-09-26 23:30 ` Hannes Frederic Sowa
[not found] ` <1380236199-3726-4-git-send-email-hannes@stressinduktion.org>
2013-09-30 19:43 ` [PATCH net-next 3/7] net: introduce new macro net_get_random_once David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-09-26 23:32 Introduce support to lazy initialize mostly static keys Hannes Frederic Sowa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).