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:   Tue, 26 May 2020 10:47:18 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     Martin KaFai Lau <kafai@...com>, bpf <bpf@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>,
        Networking <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next 0/3] bpf: Allow inner map with different max_entries

On Thu, May 21, 2020 at 4:16 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Thu, May 21, 2020 at 04:10:36PM -0700, Andrii Nakryiko wrote:
> > > > 4. Then for size check change, again, it's really much simpler and
> > > > cleaner just to have a special case in check in bpf_map_meta_equal for
> > > > cases where map size matters.
> > > It may be simpler but not necessary less fragile for future map type.
> > >
> > > I am OK for removing patch 1 and just check for a specific
> > > type in patch 2 but I think it is fragile for future map
> > > type IMO.
> >
> > Well, if we think that the good default needs to be to check size,
> > then similar to above, explicitly list stuff that *does not* follow
> > the default, i.e., maps that don't want max_elements verification. My
> > point still stands.
>
> I think consoldating map properties in bpf_types.h is much cleaner
> and less error prone.

Consolidation is good, but then we hopefully do it for all aspects of
maps that currently have ad-hoc checks spread across a lot of places.
Just looking at map_lookup_elem in syscall.c makes me wanna cry, for
example :) I'll reply on another thread where Daniel proposed putting
everything into ops, I like that better.

> I'd only like to tweak the macro in patch 1 to avoid explicit ", 0)".
> Can BPF_MAP_TYPE() macro stay as-is and additional macro introduced
> for maps with properties ? BPF_MAP_TYPE_FL() ?
> Or do some macro magic that the same macro can be used with 2 and 3 args?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ