From 726e1e13ff93e2cc1ac21964dc8d906869e64406 Mon Sep 17 00:00:00 2001 From: Rainer Toebbicke Date: Wed, 24 Feb 2010 12:02:08 +0100 Subject: [PATCH] Do not leak information on partial success in RXAFS_InlineBulkStatus Initialize all RXAFS_InlineBulkStatus return parameters in case portions remain unset on FetchStatus failures. Also ensure VolSync info is set even if the first FetchStatus fails. Change-Id: I8c502d25ef1362675fed2871dbd8c3c4e76af55b Reviewed-on: http://gerrit.openafs.org/1396 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/viced/afsfileprocs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index b15372d8d..ec9eea699 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -2731,6 +2731,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, struct host *thost; struct client *t_client = NULL; /* tmp ptr to client data */ AFSFetchStatus *tstatus; + int VolSync_set = 0; #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -2773,6 +2774,11 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, } CallBacks->AFSCBs_len = nfiles; + /* Zero out return values to avoid leaking information on partial succes */ + memset(OutStats->AFSBulkStats_val, 0, nfiles * sizeof(struct AFSFetchStatus)); + memset(CallBacks->AFSCBs_val, 0, nfiles * sizeof(struct AFSCallBack)); + memset(Sync, 0, sizeof(*Sync)); + if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost))) { goto Bad_InlineBulkStatus; } @@ -2799,8 +2805,10 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, } /* set volume synchronization information, but only once per call */ - if (i == 0) + if (!VolSync_set) { SetVolumeSync(Sync, volptr); + VolSync_set = 1; + } /* Are we allowed to fetch Fid's status? */ if (targetptr->disk.type != vDirectory) { -- 2.39.5