]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
OPENAFS-SA-2018-002 volser: prevent AFSVolMonitor information leak
authorMark Vitale <mvitale@sinenomine.net>
Tue, 26 Jun 2018 07:00:02 +0000 (03:00 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Sun, 9 Sep 2018 23:34:54 +0000 (18:34 -0500)
AFSVolMonitor (vos status) does not properly initialize its output
buffers.  This leaks information from volserver memory:

struct transDebugInfo
- up to 29 bytes in member lastProcName (30-'\0')
- 16 bytes in members readNext, tranmitNext, lastSendTime,
  lastReceiveTime

Initialize the buffers.  This must be done on a per-buffer basis inside
the loop, since realloc is used to expand the storage if needed,
and there is not a standard realloc API to zero the newly allocated storage.

[kaduk@mit.edu: update commit message]

(cherry picked from commit 26924fd508b21bb6145e77dc31b6cd0923193b72)

Change-Id: Id10aa1f4d0b8694f6d85468d743c2fc2a8102339

src/volser/volprocs.c

index 537e50a5d0239968d41bb85df3bb595b8693acfa..985c0a01da87fbd7f9e4fc7185eac0b093153ceb 100644 (file)
@@ -2846,6 +2846,7 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo)
        goto done;              /*no active transactions */
     for (tt = allTrans; tt; tt = nt) { /*copy relevant info into pntr */
        nt = tt->next;
+       memset(pntr, 0, sizeof(*pntr));
         VTRANS_OBJ_LOCK(tt);
        pntr->tid = tt->tid;
        pntr->time = tt->time;