Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546843

Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random: use SipHash in place of MD5)

From Daniel Borkmann <daniel@iogearbox.net>
Newsgroups linux.kernel
Subject Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random: use SipHash in place of MD5)
Date 2016-12-23 13:10 +0100
Message-ID <sRwPD-6HP-1@gated-at.bofh.it> (permalink)
References <sRe6l-3cC-13@gated-at.bofh.it> <sReSJ-3uM-5@gated-at.bofh.it> <sRuXw-5wu-19@gated-at.bofh.it> <sRvJU-5Nx-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/23/2016 11:59 AM, Hannes Frederic Sowa wrote:
> On Fri, 2016-12-23 at 11:04 +0100, Daniel Borkmann wrote:
>> On 12/22/2016 05:59 PM, Hannes Frederic Sowa wrote:
>>> On Thu, 2016-12-22 at 08:07 -0800, Andy Lutomirski wrote:
[...]
>>> The hashing is not a proper sha1 neither, unfortunately. I think that
>>> is why it will have a custom implementation in iproute2?
>>
>> Still trying to catch up on this admittedly bit confusing thread. I
>> did run automated tests over couple of days comparing the data I got
>> from fdinfo with the one from af_alg and found no mismatch on the test
>> cases varying from min to max possible program sizes. In the process
>> of testing, as you might have seen on netdev, I found couple of other
>> bugs in bpf code along the way and fixed them up as well. So my question,
>> do you or Andy or anyone participating in claiming this have any
>> concrete data or test cases that suggests something different? If yes,
>> I'm very curious to hear about it and willing fix it up, of course.
>> When I'm back from pto I'll prep and cook up my test suite to be
>> included into the selftests/bpf/, should have done this initially,
>> sorry about that. I'll also post something to expose the alg, that
>> sounds fine to me.
>
> Looking into your code closer, I noticed that you indeed seem to do the
> finalization of sha-1 by hand by aligning and padding the buffer
> accordingly and also patching in the necessary payload length.
>
> Apologies for my side for claiming that this is not correct sha1
> output, I was only looking at sha_transform and its implementation and
> couldn't see the padding and finalization round with embedding the data
> length in there and hadn't thought of it being done manually.
>
> Anyway, is it difficult to get the sha finalization into some common
> code library? It is not very bpf specific and crypto code reviewers
> won't find it there at all.

Yes, sure, I'll rework it that way (early next year when I'm back if
that's fine with you).

Thanks,
Daniel

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random: use  SipHash in place of MD5) Andy Lutomirski <luto@amacapital.net> - 2016-12-22 17:10 +0100
  Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-22 17:30 +0100
    Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Andy Lutomirski <luto@amacapital.net> - 2016-12-22 18:00 +0100
  Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6]  random: use SipHash in place of MD5) Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-12-22 18:00 +0100
    Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Andy Lutomirski <luto@amacapital.net> - 2016-12-22 18:30 +0100
      Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6]  random: use SipHash in place of MD5) Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-12-22 19:00 +0100
      Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-12-22 20:40 +0100
        Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Andy Lutomirski <luto@kernel.org> - 2016-12-22 21:00 +0100
          Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-12-22 21:10 +0100
      Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Daniel Borkmann <daniel@iogearbox.net> - 2016-12-23 11:30 +0100
    Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-22 19:20 +0100
    Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Daniel Borkmann <daniel@iogearbox.net> - 2016-12-23 11:10 +0100
      Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6]  random: use SipHash in place of MD5) Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-12-23 12:00 +0100
        Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Daniel Borkmann <daniel@iogearbox.net> - 2016-12-23 13:10 +0100
          Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Andy Lutomirski <luto@amacapital.net> - 2016-12-23 17:30 +0100
            Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Andy Lutomirski <luto@amacapital.net> - 2016-12-23 17:50 +0100
              Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-12-23 19:20 +0100
                Re: BPF hash algo (Re: [kernel-hardening] Re: [PATCH v7 3/6] random:  use SipHash in place of MD5) "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-23 22:20 +0100

csiph-web