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  linux-hardening  linux-cve-announce  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]
Message-ID: <CAADnVQJf5ZbJ11ytgyWxGoKoXTvDtpjn_EAw23rCppoY8LtiBA@mail.gmail.com>
Date:   Tue, 9 Nov 2021 13:52:04 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Dmitrii Banshchikov <me@...que.spb.ru>
Cc:     bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Network Development <netdev@...r.kernel.org>,
        Andrey Ignatov <rdna@...com>,
        John Stultz <john.stultz@...aro.org>, sboyd@...nel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Mark Rutland <mark.rutland@....com>,
        Steven Rostedt <rosted@...dmis.org>,
        syzbot <syzbot+43fd005b5a1b4d10781e@...kaller.appspotmail.com>
Subject: Re: [PATCH bpf 1/2] bpf: Forbid bpf_ktime_get_coarse_ns and
 bpf_timer_* in tracing progs

On Mon, Nov 8, 2021 at 8:46 AM Dmitrii Banshchikov <me@...que.spb.ru> wrote:
>
> bpf_ktime_get_coarse_ns() helper uses ktime_get_coarse_ns() time
> accessor that isn't safe for any context.
> This results in locking issues:

Please trim the cc. vger thinks it's a spam.
The patch didn't reach the mailing list or patchwork.

>  const struct bpf_func_proto bpf_ktime_get_coarse_ns_proto = {
>         .func           = bpf_ktime_get_coarse_ns,
>         .gpl_only       = false,
>         .ret_type       = RET_INTEGER,
> +       .allowed        = bpf_ktime_get_coarse_ns_allowed,

I think it's easier to move to networking prog types
instead of going through a callback.

>  static const struct bpf_func_proto bpf_timer_init_proto = {
>         .func           = bpf_timer_init,
>         .gpl_only       = true,
> @@ -1147,6 +1173,7 @@ static const struct bpf_func_proto bpf_timer_init_proto = {
>         .arg1_type      = ARG_PTR_TO_TIMER,
>         .arg2_type      = ARG_CONST_MAP_PTR,
>         .arg3_type      = ARG_ANYTHING,
> +       .allowed        = bpf_timer_allowed,

I think disabling timers in check_map_prog_compatibility
(similar to how bpf_spin_lock is restricted) would be cleaner.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ