]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/linux/bpf.h
bpf: add map_alloc_check callback
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 12 Jan 2018 04:29:03 +0000 (20:29 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:58:00 +0000 (14:58 +0200)
commit144bc4890398441fdafb7990ff6a9b7d4502e184
treedf78d4bbee8d705fa327d4c158ba58473963dc9c
parent36d122a1ee8d93ecc04eb39a66fce7cb6642e01c
bpf: add map_alloc_check callback

BugLink: http://bugs.launchpad.net/bugs/1794889
.map_alloc callbacks contain a number of checks validating user-
-provided map attributes against constraints of a particular map
type.  For offloaded maps we will need to check map attributes
without actually allocating any memory on the host.  Add a new
callback for validating attributes before any memory is allocated.
This callback can be selectively implemented by map types for
sharing code with offloads, or simply to separate the logical
steps of validation and allocation.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
(cherry picked from commit 1110f3a9bcf394c06b81a98206aee9b6860653c8)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/linux/bpf.h
kernel/bpf/syscall.c