]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix leak in LINK_UPDATE and enforce empty old_prog_fd
authorAndrii Nakryiko <andriin@fb.com>
Fri, 24 Apr 2020 05:20:44 +0000 (22:20 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 25 Apr 2020 00:27:02 +0000 (17:27 -0700)
commitfabddde6b132d1adc42c967d82c7867c49a14bd7
tree776699a09bc08d7e2c68d409e67616827ad3a399
parent636b10f782c0914c19a52ebdc6b772787bd4df46
bpf: Fix leak in LINK_UPDATE and enforce empty old_prog_fd

Fix bug of not putting bpf_link in LINK_UPDATE command.
Also enforce zeroed old_prog_fd if no BPF_F_REPLACE flag is specified.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200424052045.4002963-1-andriin@fb.com
kernel/bpf/syscall.c