]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Use SOCK_CLOEXEC when opening the netlink socket
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Wed, 17 Mar 2021 11:58:58 +0000 (17:28 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Mar 2021 23:50:21 +0000 (00:50 +0100)
commitabefd5048e38cd7624620ccf80b2f824f614af64
tree1e62f2aa641a6d19717b5ae4fd6a7becde548892
parentd9981f002df78c43fd0f3a6008772acac3999cd8
libbpf: Use SOCK_CLOEXEC when opening the netlink socket

Otherwise, there exists a small window between the opening and closing
of the socket fd where it may leak into processes launched by some other
thread.

Fixes: 2e8290ccfe4a ("libbpf: add function to setup XDP")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20210317115857.6536-1-memxor@gmail.com
tools/lib/bpf/netlink.c