NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/46773: librpc segfaults when out of memory



The following reply was made to PR lib/46773; it has been noted by GNATS.

From: Matthew Mondor <mm_lists%pulsar-zone.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: lib/46773: librpc segfaults when out of memory
Date: Tue, 7 Aug 2012 03:40:24 -0400

 On Mon,  6 Aug 2012 07:05:00 +0000 (UTC)
 brehm%gmx.de@localhost wrote:
 
 > When system is out of or low on memory, "xdrrec_create" in 
 > "src/lib/libc/rpc/xdrrec_create.c" bails out, prints the warning 
 > "xdrrec_create: out of memory", and leaves xdrs->x_private == NULL.
 > 
 > However, the "makefd_xprt" does not check if "xdrrec_create" was successful 
 > and will segfault in this case (by dereferencing "xdrs->x_private" 
 > unconditionally).
 > 
 > Attached patch adds appropriate checks to "xdrrec_create" callers, so they 
 > also bail out when "xdrrec_create" did.
 
 By looking briefly at the netbsd-6 code, it appears that it also has
 this issue.
 
 Thanks,
 -- 
 Matt
 


Home | Main Index | Thread Index | Old Index