summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorBjörn Töpel <bjorn.topel@intel.com>2019-03-13 15:15:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-04 09:20:12 +0200
commit947bd0d9bdbc3191835612c2a69eab7d8cebf746 (patch)
tree9158b65da910798bbfb4acc0f8e6eac262f56e1b /include/net
parentfc055dffa5751859f5043f1c1e91bfafe2c6a6e9 (diff)
xsk: fix umem memory leak on cleanup
[ Upstream commit 044175a06706d516aa42874bb44dbbfc3c4d20eb ] 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: c0c77d8fb787 ("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> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/xdp_sock.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 7161856bcf9c..c2c10cc9ffa0 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -34,7 +34,6 @@ struct xdp_umem {
u32 headroom;
u32 chunk_size_nohr;
struct user_struct *user;
- struct pid *pid;
unsigned long address;
refcount_t users;
struct work_struct work;