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] [day] [month] [year] [list]
Date:   Fri, 17 Jul 2020 16:13:52 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Lorenzo Bianconi <lorenzo@...nel.org>
Cc:     Jakub Sitnicki <jakub@...udflare.com>,
        Network Development <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Toke Høiland-Jørgensen <toke@...hat.com>,
        lorenzo.bianconi@...hat.com, David Ahern <dsahern@...nel.org>,
        Andrii Nakryiko <andrii.nakryiko@...il.com>,
        bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH v7 bpf-next 0/9] introduce support for XDP programs in CPUMAP

On Fri, Jul 17, 2020 at 12:13 PM Lorenzo Bianconi <lorenzo@...nel.org> wrote:
>
> > On Fri, 17 Jul 2020 13:01:36 +0200
> > Lorenzo Bianconi <lorenzo@...nel.org> wrote:
> >
>
> [...]
>
> >
> > HTH,
> > -jkbs
>
> Hi Jakub,
>
> can you please test the patch below when you have some free cycles? It fixes
> the issue in my setup.
>
> Regards,
> Lorenzo
>
> diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
> index 4c95d0615ca2..f1c46529929b 100644
> --- a/kernel/bpf/cpumap.c
> +++ b/kernel/bpf/cpumap.c
> @@ -453,24 +453,27 @@ __cpu_map_entry_alloc(struct bpf_cpumap_val *value, u32 cpu, int map_id)
>         rcpu->map_id = map_id;
>         rcpu->value.qsize  = value->qsize;
>
> +       if (fd > 0 && __cpu_map_load_bpf_program(rcpu, fd))
> +               goto free_ptr_ring;
> +
>         /* Setup kthread */
>         rcpu->kthread = kthread_create_on_node(cpu_map_kthread_run, rcpu, numa,
>                                                "cpumap/%d/map:%d", cpu, map_id);
>         if (IS_ERR(rcpu->kthread))
> -               goto free_ptr_ring;
> +               goto free_prog;
>
>         get_cpu_map_entry(rcpu); /* 1-refcnt for being in cmap->cpu_map[] */
>         get_cpu_map_entry(rcpu); /* 1-refcnt for kthread */
>
> -       if (fd > 0 && __cpu_map_load_bpf_program(rcpu, fd))
> -               goto free_ptr_ring;
> -
>         /* Make sure kthread runs on a single CPU */
>         kthread_bind(rcpu->kthread, cpu);
>         wake_up_process(rcpu->kthread);
>
>         return rcpu;
>
> +free_prog:
> +       if (rcpu->prog)
> +               bpf_prog_put(rcpu->prog);
>  free_ptr_ring:
>         ptr_ring_cleanup(rcpu->queue, NULL);
>  free_queue:

Please send it as a proper patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ