lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 26 Apr 2020 09:47:16 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Maciej Żenczykowski <zenczykowski@...il.com>
Cc:     Maciej Żenczykowski <maze@...gle.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Linux Network Development Mailing List 
        <netdev@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
        "David S . Miller" <davem@...emloft.net>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH] net: bpf: add bpf_ktime_get_boot_ns()

On Sun, Apr 26, 2020 at 9:31 AM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Mon, Apr 20, 2020 at 01:26:43PM -0700, Maciej Żenczykowski wrote:
> > From: Maciej Żenczykowski <maze@...gle.com>
> >
> > On a device like a cellphone which is constantly suspending
> > and resuming CLOCK_MONOTONIC is not particularly useful for
> > keeping track of or reacting to external network events.
> > Instead you want to use CLOCK_BOOTTIME.
> >
> > Hence add bpf_ktime_get_boot_ns() as a mirror of bpf_ktime_get_ns()
> > based around CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
> >
> > Signed-off-by: Maciej Żenczykowski <maze@...gle.com>
> ...
> > diff --git a/net/core/filter.c b/net/core/filter.c
> > index 755867867e57..ec567d1e6fb9 100644
> > --- a/net/core/filter.c
> > +++ b/net/core/filter.c
> > @@ -6009,6 +6009,8 @@ bpf_base_func_proto(enum bpf_func_id func_id)
> >               return &bpf_tail_call_proto;
> >       case BPF_FUNC_ktime_get_ns:
> >               return &bpf_ktime_get_ns_proto;
> > +     case BPF_FUNC_ktime_get_boot_ns:
> > +             return &bpf_ktime_get_boot_ns_proto;
> >       default:
> >               break;
> >       }
>
> That part got moved into kernel/bpf/helpers.c in the mean time.
> I fixed it up and applied. Thanks
>
> In the future please cc bpf@...r for all bpf related patches.

The order of comments for bpf_ktime_get_boot_ns
was also incorrect.
Most selftests were broken.
I fixed it up as well.

Powered by blists - more mailing lists