• Daniel Borkmann's avatar
    bpf: do not retain flags that are not tied to map lifetime · be70bcd5
    Daniel Borkmann authored
    Both BPF_F_WRONLY / BPF_F_RDONLY flags are tied to the map file
    descriptor, but not to the map object itself! Meaning, at map
    creation time BPF_F_RDONLY can be set to make the map read-only
    from syscall side, but this holds only for the returned fd, so
    any other fd either retrieved via bpf file system or via map id
    for the very same underlying map object can have read-write access
    instead.
    
    Given that, keeping the two flags around in the map_flags attribute
    and exposing them to user space upon map dump is misleading and
    may lead to false conclusions. Since these two flags are not
    tied to the map object lets also not store them as map property.
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    be70bcd5
syscall.c 64.8 KB