]> asedeno.scripts.mit.edu Git - linux.git/commit
bpf: hashtab: move attribute validation before allocation
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 12 Jan 2018 04:29:04 +0000 (20:29 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Sun, 14 Jan 2018 22:36:29 +0000 (23:36 +0100)
commitdaffc5a2e6f4bf4f99b00e183117920e321b6763
tree30fb6e39546cc240144e66f3b4fa4d555d7aa6fa
parent1110f3a9bcf394c06b81a98206aee9b6860653c8
bpf: hashtab: move attribute validation before allocation

Number of attribute checks are currently performed after hashtab
is already allocated.  Move them to be able to split them out to
the check function later on.  Checks have to now be performed on
the attr union directly instead of the members of bpf_map, since
bpf_map will be allocated later.  No functional changes.

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>
kernel/bpf/hashtab.c