From: Rainer Toebbicke Date: Wed, 24 Feb 2010 11:02:08 +0000 (+0100) Subject: Do not leak information on partial success in RXAFS_InlineBulkStatus X-Git-Tag: openafs-devel-1_5_73~130 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=726e1e13ff93e2cc1ac21964dc8d906869e64406;hp=70c975728382557669d6f76b1b465efc54c3e216 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 --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index b15372d..ec9eea6 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) {