]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix memory leaks in generic update/delete batch ops
authorBrian Vazquez <brianvv@google.com>
Sun, 19 Jan 2020 19:40:40 +0000 (11:40 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 20 Jan 2020 21:27:51 +0000 (22:27 +0100)
commite570ffabbb2e6c92acb2f7e0853035c3a9068817
tree18ee2f84509602f1383c1dcf8a55d49130bb342e
parenta6a9d324fe4865faff6ec533ca52d3c486fcaafc
bpf: Fix memory leaks in generic update/delete batch ops

Generic update/delete batch ops functions were using __bpf_copy_key
without properly freeing the memory. Handle the memory allocation and
copy_from_user separately.

Fixes: 352625a1b08d ("bpf: Add generic support for update and delete batch ops")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Vazquez <brianvv@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200119194040.128369-1-brianvv@google.com
kernel/bpf/syscall.c