From a4615ef9462621955fa70f85b1cc0b6795821a07 Mon Sep 17 00:00:00 2001 From: Kaihao Bai Date: Tue, 13 Dec 2022 18:39:15 +0800 Subject: [PATCH] add bugfix and spec optimization --- ...nd-fix-double-free-in-init_transport.patch | 35 +++++++++++++++++++ rpcbind.spec | 7 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 rpcbind-fix-double-free-in-init_transport.patch diff --git a/rpcbind-fix-double-free-in-init_transport.patch b/rpcbind-fix-double-free-in-init_transport.patch new file mode 100644 index 0000000..3384fd8 --- /dev/null +++ b/rpcbind-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 f5077ff..773144d 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 # These are macros to be usable outside of the build section %global rpcbind_user_group rpc @@ -30,6 +30,7 @@ Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch Patch102: rpcbind-0.2.4-runstatdir.patch Patch103: rpcbind-0.2.4-systemd-service.patch Patch104: rpcbind-0.2.4-systemd-rundir.patch +Patch105: rpcbind-fix-double-free-in-init_transport.patch Provides: portmap = %{version}-%{release} Obsoletes: portmap <= 4.0-65.3 @@ -79,7 +80,6 @@ cd ${RPM_BUILD_ROOT}%{_sbindir} ln -sf ../bin/rpcbind ln -sf ../bin/rpcinfo - %pre # Softly static allocate the rpc uid and gid. @@ -127,6 +127,9 @@ fi %doc AUTHORS ChangeLog README %changelog +* Tue Jan 03 2023 Kaihao Bai - 1.2.6-3 +- add bugfix patch + * Mon Oct 10 2022 mgb01105731 - 1.2.6-2 - add doc package -- Gitee