From 4a6b9c2caedccfed4fd4da65e4ec9006b7eb29bd Mon Sep 17 00:00:00 2001 From: baiguo Date: Thu, 8 Aug 2024 13:58:58 +0800 Subject: [PATCH] libxdp: Fix xdp prog memory leak in xsk_setup_xdp_prog --- ...rog-memory-leak-in-xsk_setup_xdp_pro.patch | 25 +++++++++++++++++++ xdp-tools.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 backport-0001-libxdp-Fix-xdp-prog-memory-leak-in-xsk_setup_xdp_pro.patch diff --git a/backport-0001-libxdp-Fix-xdp-prog-memory-leak-in-xsk_setup_xdp_pro.patch b/backport-0001-libxdp-Fix-xdp-prog-memory-leak-in-xsk_setup_xdp_pro.patch new file mode 100644 index 0000000..9a34761 --- /dev/null +++ b/backport-0001-libxdp-Fix-xdp-prog-memory-leak-in-xsk_setup_xdp_pro.patch @@ -0,0 +1,25 @@ +From b571b2c5011a5f2aedcf9343a08ce4836e2a9753 Mon Sep 17 00:00:00 2001 +From: Ric Li +Date: Tue, 21 Nov 2023 15:36:57 +0800 +Subject: [PATCH] libxdp: Fix xdp prog memory leak in xsk_setup_xdp_prog +Reference:https://github.com/xdp-project/xdp-tools/pull/376/commits/b571b2c5011a5f2aedcf9343a08ce4836e2a9753 + +--- + lib/libxdp/xsk.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/libxdp/xsk.c b/lib/libxdp/xsk.c +index a854f77..b3527fb 100644 +--- a/lib/libxdp/xsk.c ++++ b/lib/libxdp/xsk.c +@@ -978,6 +978,7 @@ static struct xsk_ctx *xsk_create_ctx(struct xsk_socket *xsk, + + static void xsk_destroy_xsk_struct(struct xsk_socket *xsk) + { ++ xdp_program__close(xsk->ctx->xdp_prog); + free(xsk->ctx); + free(xsk); + } +-- +2.27.0 + diff --git a/xdp-tools.spec b/xdp-tools.spec index 0382451..17fe4a7 100644 --- a/xdp-tools.spec +++ b/xdp-tools.spec @@ -7,13 +7,14 @@ Name: xdp-tools Version: 1.4.1 -Release: 1 +Release: 2 Summary: Utilities and example programs for use with XDP %global _soversion 1.4.0 License: GPLv2 URL: https://github.com/xdp-project/%{name} Source0: https://github.com/xdp-project/%{name}/archive/v%{version}.tar.gz +Patch0001: backport-0001-libxdp-Fix-xdp-prog-memory-leak-in-xsk_setup_xdp_pro.patch BuildRequires: libbpf-devel BuildRequires: elfutils-libelf-devel @@ -117,6 +118,9 @@ make install V=1 %{_libdir}/pkgconfig/libxdp.pc %changelog +* Thu Aug 8 2024 baiguo 1.4.1-2 +- libxdp: Fix xdp prog memory leak in xsk_setup_xdp_prog + * Fri Dec 22 2023 Ouuleilei 1.4.1-1 - upgrade to 1.4.1 -- Gitee