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]
Date:   Tue, 1 Feb 2022 10:25:06 +0800
From:   htbegin <hotforest@...il.com>
To:     Daniel Borkmann <daniel@...earbox.net>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Martin KaFai Lau <kafai@...com>, Yonghong Song <yhs@...com>,
        Andrii Nakryiko <andrii@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        Hou Tao <houtao1@...wei.com>
Subject: Re: [PATCH bpf-next] bpf: use VM_MAP instead of VM_ALLOC for ringbuf

Hi,

On Tue, Feb 1, 2022 at 12:28 AM Daniel Borkmann <daniel@...earbox.net> wrote:
>
> On 1/31/22 12:46 PM, Hou Tao wrote:
> > Now the ringbuf area in /proc/vmallocinfo is showed as vmalloc,
> > but VM_ALLOC is only used for vmalloc(), and for the ringbuf area
> > it is created by mapping allocated pages, so use VM_MAP instead.
> >
> > After the change, ringbuf info in /proc/vmallocinfo will changed from:
> >    [start]-[end]   24576 ringbuf_map_alloc+0x171/0x290 vmalloc user
> > to
> >    [start]-[end]   24576 ringbuf_map_alloc+0x171/0x290 vmap user
>
> Could you elaborate in the commit msg if this also has some other internal
> effect aside from the /proc/vmallocinfo listing? Thanks!
>
For now, the VM_MAP flag only affects the output in /proc/vmallocinfo.

Thanks,
Tao
> > Signed-off-by: Hou Tao <houtao1@...wei.com>
> > ---
> >   kernel/bpf/ringbuf.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
> > index 638d7fd7b375..710ba9de12ce 100644
> > --- a/kernel/bpf/ringbuf.c
> > +++ b/kernel/bpf/ringbuf.c
> > @@ -104,7 +104,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node)
> >       }
> >
> >       rb = vmap(pages, nr_meta_pages + 2 * nr_data_pages,
> > -               VM_ALLOC | VM_USERMAP, PAGE_KERNEL);
> > +               VM_MAP | VM_USERMAP, PAGE_KERNEL);
> >       if (rb) {
> >               kmemleak_not_leak(pages);
> >               rb->pages = pages;
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ