]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add __must_check attributes to refcount manipulating helpers
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 19 Nov 2016 00:45:03 +0000 (01:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Nov 2016 16:25:58 +0000 (11:25 -0500)
commit68f195dd0ed5f11c1e7f9c0840e3ebba241f24b6
tree3ecd94250b15a5c118ca12d42ad688a87f84718f
parentf33f39fdfce95bfd7bb70b2af2726980d621adf8
bpf: add __must_check attributes to refcount manipulating helpers

Helpers like bpf_prog_add(), bpf_prog_inc(), bpf_map_inc() can fail
with an error, so make sure the caller properly checks their return
value and not just ignores it, which could worst-case lead to use
after free.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf.h