]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: fix invalid munmap call
authorBjörn Töpel <bjorn.topel@intel.com>
Tue, 30 Apr 2019 12:45:35 +0000 (14:45 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 5 May 2019 06:26:22 +0000 (23:26 -0700)
commitaec6423ea240ea149159fb1790f643fd9dacab0a
tree616ecde8b6710b37a1441ff9c61b5333930193b0
parent27246d9a478257b9120c25e237220ece7eeefa3f
libbpf: fix invalid munmap call

When unmapping the AF_XDP memory regions used for the rings, an
invalid address was passed to the munmap() calls. Instead of passing
the beginning of the memory region, the descriptor region was passed
to munmap.

When the userspace application tried to tear down an AF_XDP socket,
the operation failed and the application would still have a reference
to socket it wished to get rid of.

Reported-by: William Tu <u9012063@gmail.com>
Fixes: 1630fbcf169a ("libbpf: add support for using AF_XDP sockets")
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: William Tu <u9012063@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/xsk.c