diff --git a/0003-__svc_vc_dodestroy-fix-double-free-of-xp_ltaddr.buf.patch b/0003-__svc_vc_dodestroy-fix-double-free-of-xp_ltaddr.buf.patch new file mode 100644 index 0000000..a687f28 --- /dev/null +++ b/0003-__svc_vc_dodestroy-fix-double-free-of-xp_ltaddr.buf.patch @@ -0,0 +1,50 @@ +From c300af4954948019eb58bd2cefdf373cb2994eff Mon Sep 17 00:00:00 2001 +From: srinivasa rao cheruku +Date: Thu, 28 May 2020 12:38:54 -0400 +Subject: [PATCH 3/5] __svc_vc_dodestroy: fix double free of xp_ltaddr.buf + +In svc_fd_create(), upon error, freeing xp_ltaddr.buf and null +is returned to the caller as expected. The allocated SVCXPRT is +added to svc_pollfd and during destroy __svc_vc_dodestroy(), +xp_ltaddr.buf is being freed again causing double free. + +Fix is to reset the pointer when ever freed first. + +Reported-by: Sreedharbabu Vykuntam +Reviewed-by: Ian Kent +Signed-off-by: Srinivasarao Cheruku + +Signed-off-by: Steve Dickson +--- + src/svc_vc.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/svc_vc.c b/src/svc_vc.c +index c23cd36..f1d9f00 100644 +--- a/src/svc_vc.c ++++ b/src/svc_vc.c +@@ -243,7 +243,7 @@ svc_fd_create(fd, sendsize, recvsize) + goto freedata; + } + if (!__rpc_set_netbuf(&ret->xp_rtaddr, &ss, sizeof(ss))) { +- warnx("svc_fd_create: no mem for local addr"); ++ warnx("svc_fd_create: no mem for remote addr"); + goto freedata; + } + +@@ -253,9 +253,10 @@ svc_fd_create(fd, sendsize, recvsize) + return ret; + + freedata: +- if (ret->xp_ltaddr.buf != NULL) ++ if (ret->xp_ltaddr.buf != NULL) { + mem_free(ret->xp_ltaddr.buf, rep->xp_ltaddr.maxlen); +- ++ ret->xp_ltaddr.buf = NULL; ++ } + return NULL; + } + +-- +1.8.3.1 + diff --git a/libtirpc-1.1.4.tar.bz2 b/libtirpc-1.1.4.tar.bz2 deleted file mode 100644 index 9c458b6..0000000 Binary files a/libtirpc-1.1.4.tar.bz2 and /dev/null differ diff --git a/libtirpc-1.2.6.tar.bz2 b/libtirpc-1.2.6.tar.bz2 new file mode 100644 index 0000000..2fda296 Binary files /dev/null and b/libtirpc-1.2.6.tar.bz2 differ diff --git a/libtirpc.spec b/libtirpc.spec index 9bc0d97..13a6b75 100644 --- a/libtirpc.spec +++ b/libtirpc.spec @@ -1,11 +1,12 @@ Name: libtirpc -Version: 1.1.4 +Version: 1.2.6 Release: 1 Summary: Transport-independent RPC library License: SISSL and BSD URL: http://git.linux-nfs.org/?p=steved/libtirpc.git;a=summary Source0: http://downloads.sourceforge.net/libtirpc/%{name}-%{version}.tar.bz2 Patch01: 0001-update-libtirpc-to-enable-tcp-port-listening.patch +Patch02: 0003-__svc_vc_dodestroy-fix-double-free-of-xp_ltaddr.buf.patch BuildRequires: automake autoconf libtool pkgconfig krb5-devel %description @@ -63,5 +64,11 @@ mv %{buildroot}%{_mandir}/man3 %{buildroot}%{_mandir}/man3t %{_mandir}/*/* %changelog +* Tue Jul 28 2020 lunankun -1.2.6-1 +- Type:update +- Id:NA +- SUG:NA +- DESC:update to libtirpc-1.2.6 + * Thu Aug 29 2019 openEuler Buildteam - 1.1.4-1 - Package init