[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 8 Aug 2019 13:09:28 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Eric Dumazet <edumazet@...gle.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
m@...bda.lt, Alexei Starovoitov <ast@...nel.org>,
Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net 1/2] sock: make cookie generation global instead of
per netns
On 8/8/19 12:45 PM, Eric Dumazet wrote:
> On Thu, Aug 8, 2019 at 11:50 AM Daniel Borkmann <daniel@...earbox.net> wrote:
>
>> Socket cookie consumers must assume the value as opqaue in any case.
>> The cookie does not guarantee an always unique identifier since it
>> could wrap in fabricated corner cases where two sockets could end up
>> holding the same cookie,
>
> What do you mean by this ?
>
> Cookie is guaranteed to be unique, it is from a 64bit counter...
>
> There should be no collision.
I meant the [theoretical] corner case where socket_1 has cookie X and
we'd create, trigger sock_gen_cookie() to increment, close socket in a
loop until we wrap and get another cookie X for socket_2; agree it's
impractical and for little gain anyway. So in practice there should be
no collision which is what I tried to say.
Thanks,
Daniel
Powered by blists - more mailing lists