From 82e4cc63c8f29a9b2cba0edcf50cc90648a27d83 Mon Sep 17 00:00:00 2001 From: quanhongfie Date: Mon, 28 Feb 2022 16:45:32 +0800 Subject: [PATCH] fix double free --- ...rt-fix-double-free-in-init_transport.patch | 35 +++++++++++++++++++ rpcbind.spec | 9 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 backport-fix-double-free-in-init_transport.patch diff --git a/backport-fix-double-free-in-init_transport.patch b/backport-fix-double-free-in-init_transport.patch new file mode 100644 index 0000000..3384fd8 --- /dev/null +++ b/backport-fix-double-free-in-init_transport.patch @@ -0,0 +1,35 @@ +From 1e00cd123044661fd4f921d1e7216ed9255bb3d1 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Tue, 1 Feb 2022 08:46:40 -0500 +Subject: [PATCH] rpcbind: fix double free in init_transport + +$ rpcbind -h 127.0.0.1 +free(): double free detected in tcache 2 +Aborted + +Fixes: a6889bba949b ("Removed resource leaks from src/rpcbind.c") +Resolves: https://sourceforge.net/p/rpcbind/bugs/6/ +Signed-off-by: Dmitry V. Levin +Signed-off-by: Steve Dickson +--- + src/rpcbind.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/rpcbind.c b/src/rpcbind.c +index 25d8a90..ecebe97 100644 +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -552,8 +552,10 @@ init_transport(struct netconfig *nconf) + syslog(LOG_ERR, "cannot bind %s on %s: %m", + (hosts[nhostsbak] == NULL) ? "*" : + hosts[nhostsbak], nconf->nc_netid); +- if (res != NULL) ++ if (res != NULL) { + freeaddrinfo(res); ++ res = NULL; ++ } + continue; + } else + checkbind++; +-- +1.8.3.1 diff --git a/rpcbind.spec b/rpcbind.spec index efd5d5c..f1b47b3 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -3,7 +3,7 @@ Name: rpcbind Version: 1.2.6 -Release: 2 +Release: 3 Summary: Universal addresses to RPC program number mapper License: BSD @@ -27,6 +27,7 @@ Patch103: %{name}-0.2.4-systemd-service.patch Patch104: %{name}-0.2.4-systemd-rundir.patch Patch105: bugfix-rpcbind-GETADDR-return-client-ip.patch Patch6001: CVE-2017-8779.patch +Patch6002: backport-fix-double-free-in-init_transport.patch Patch9000: bugfix-listen-tcp-port-111.patch Provides: portmap = %{version}-%{release} @@ -116,6 +117,12 @@ fi %{_mandir}/man8/*.8.gz %changelog +* Mon Feb 28 2022 quanhongfei - 1.2.6-3 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:fix double free in init_transport + * Wed Feb 09 2022 yanglu - 1.2.6-2 - Type:bugfix - Id:NA -- Gitee