]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: fix umem memory leak on cleanup
authorBjörn Töpel <bjorn.topel@intel.com>
Wed, 13 Mar 2019 14:15:49 +0000 (15:15 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 16 Mar 2019 00:27:51 +0000 (01:27 +0100)
commit2d36857294b373d6960c6f7fee1b19a7d176833c
tree3f937ac758c9a92675819eb56c77dada33e92880
parent5c972d0e2caade45ce810c2025537561f4009348
xsk: fix umem memory leak on cleanup

When the umem is cleaned up, the task that created it might already be
gone. If the task was gone, the xdp_umem_release function did not free
the pages member of struct xdp_umem.

It turned out that the task lookup was not needed at all; The code was
a left-over when we moved from task accounting to user accounting [1].

This patch fixes the memory leak by removing the task lookup logic
completely.

[1] https://lore.kernel.org/netdev/20180131135356.19134-3-bjorn.topel@gmail.com/

Link: https://lore.kernel.org/netdev/c1cb2ca8-6a14-3980-8672-f3de0bb38dfd@suse.cz/
Fixes: 5fb4c4086995 ("xsk: add user memory registration support sockopt")
Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/net/xdp_sock.h
net/xdp/xdp_umem.c