|
|
Message-ID: <ff306468-f480-4835-befd-7d2370770914@oracle.com>
Date: Thu, 3 Dec 2026 14:56:51 +0100
From: "Casper H.S. Dik - Senior Principal Software Engineer"
<casper.dik@...cle.com>
To: oss-security@...ts.openwall.com
Subject: Re: Sun RPC cross-request information
disclosure due to stale buffer read
Hi Florian,
Thanks for the report.
Looking through the old source code archive, so like that most have
existed in SunOS 3.0, around 1984.
There are several copied in Solaris itself today and I have located
three different version; the original version work on sockets and later
STREAM based networking.
Unfortunately, the proposed fix is not correct.
diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
--- a/sunrpc/svc_udp.c
+++ b/sunrpc/svc_udp.c
@@ -297,9 +297,15 @@ svcudp_recv (SVCXPRT *xprt, struct rpc_msg *msg)
if (rlen < 16) /* < 4 32-bit ints? */
return FALSE;
xdrs->x_op = XDR_DECODE;
- XDR_SETPOS (xdrs, 0);
+ if (!XDR_SETPOS (xdrs, 0))
+ return FALSE;
+ /* Bound decode to bytes received in this datagram. */
+ xdrs->x_private = xdrs->x_base;
+ xdrs->x_handy = (u_int) rlen;
if (!xdr_callmsg (xdrs, msg))
return FALSE;
The xdrs structure has three important fields when it comes to consuming
data and one implicit field:
* x_base: the address of the buffer
* x_private: the address of where we are currently are in the buffer
* x_handy: how much we have consumed.
* the size of the buffer; it only be derived: x_bufsize = x_handy +
(x_private - x_base)
By changing x_handy, we lose the the size of the buffer and we can no
longer send a reply larger than he size of the (small) request. By
changing the reply of PROC_EXIT in tst-udp-stale.c to be much bigger, we
can no longer send such a reply.
The bad news is that the actual use of "x_handy" is *after* we returned
from svcudp_recv() and so need to find another way to restore the size
of x_handy; I suggest adding a field x_bufsize to struct XDR and set it
when we create an XDR and restore x_handy when we call XDR_SETPOS(xdrs, 0).
Casper
Powered by blists - more mailing lists
Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.