Commits/
merge fix-cve-2026-85977-master into master
3 file(s) changed+197-1
Abackport-CVE-2026-85977-1.patch+68-0
@@ -0,0 +1,68 @@
1+From 9c15036c6c450f44813e4d8c9d2de32707bfaafa Mon Sep 17 00:00:00 2001
2+From: Olga Kornievskaia <okorniev@redhat.com>
3+Date: Sat, 12 Sep 2026 15:12:14 -0400
4+Subject: libtirpc: Fix use-after-free in xdr_pmaplist() XDR_FREE path
5+ 
6+The XDR_FREE loop saved a pointer to the pml_next field inside the
7+struct being freed (next = &((*rp)->pml_next)), then dereferenced it
8+on the next iteration. This reads freed memory.
9+ 
10+Adopt the same pattern xdr_rpcblist_ptr() already uses: save the
11+value of the next pointer before freeing, then point rp at a stack
12+copy.
13+ 
14+Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
15+Signed-off-by: Steve Dickson <steved@redhat.com>
16+Reference: https://git.linux-nfs.org/?p=steved/libtirpc.git;a=patch;h=9c15036c6c450f44813e4d8c9d2de32707bfaafa
17+Conflict: NA
18+ 
19+---
20+ INSTALL | 2 +-
21+ src/pmap_prot2.c | 12 +++++++++---
22+ 2 files changed, 10 insertions(+), 4 deletions(-)
23+ 
24+diff --git a/INSTALL b/INSTALL
25+index 4f977c8..01ca381 120000
26+--- a/INSTALL
27++++ b/INSTALL
28+@@ -1 +1 @@
29+-/usr/share/automake-1.17/INSTALL
30+ 
31++/usr/share/automake-1.18/INSTALL
32+ 
33+diff --git a/src/pmap_prot2.c b/src/pmap_prot2.c
34+index bbac74f..7611bd5 100644
35+--- a/src/pmap_prot2.c
36++++ b/src/pmap_prot2.c
37+@@ -88,7 +88,8 @@ xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
38+ */
39+ bool_t more_elements;
40+ int freeing;
41+- struct pmaplist **next = NULL; /* pacify gcc */
42++ struct pmaplist *next = NULL;
43++ struct pmaplist *next_copy;
44+
45+ assert(xdrs != NULL);
46+ assert(rp != NULL);
47+@@ -107,11 +108,16 @@ xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
48+ * before we free the current object ...
49+ */
50+ if (freeing)
51+- next = &((*rp)->pml_next);
52++ next = (*rp)->pml_next;
53+ if (! xdr_reference(xdrs, (caddr_t *)rp,
54+ (u_int)sizeof(struct pmaplist), (xdrproc_t)xdr_pmap))
55+ return (FALSE);
56+- rp = (freeing) ? next : &((*rp)->pml_next);
57++ if (freeing) {
58++ next_copy = next;
59++ rp = &next_copy;
60++ } else {
61++ rp = &((*rp)->pml_next);
62++ }
63+ }
64+ }
65+
66+--
67+cgit
68+ 
Abackport-CVE-2026-85977-2.patch+120-0
Mlibtirpc.spec+9-1

Comments