From: Mark Vitale Date: Fri, 6 Jul 2018 07:21:26 +0000 (-0400) Subject: OPENAFS-SA-2018-003 volser: prevent unbounded input to various AFSVol* RPCs X-Git-Tag: openafs-devel-1_9_0~463 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=8b92d015ccdfcb70c7acfc38e330a0475a1fbe28 OPENAFS-SA-2018-003 volser: prevent unbounded input to various AFSVol* RPCs Several AFSVol* RPCs are defined with an unbounded XDR "string" as input. RPCs with unbounded arrays as inputs are susceptible to remote denial-of-service (DOS) attacks. A malicious client may submit an AFSVol* request with an arbitrarily large string, forcing the volserver to expend large amounts of network bandwidth, cpu cycles, and heap memory to unmarshal the input. Instead, give each input "string" an appropriate size. Volume names are inherently capped to 32 octets (including trailing NUL) by the protocol, but there is less clearly a hard limit on partition names. The Vol_PartitionInfo{,64} functions accept a partition name as input and also return a partition name in the output structure; the output values have wire-protocol limits, so larger values could not be retrieved by clients, but for denial-of-service purposes, a more generic PATH_MAX-like value seems appropriate. We have several varying sources of such a limit in the tree, but pick 4k as the least-restrictive. [kaduk@mit.edu: use a larger limit for pathnames and expand on PATH_MAX in commit message] Change-Id: Iea4b24d1bb3570d4c422dd0c3247cd38cdbf4bab --- diff --git a/src/volser/volint.xg b/src/volser/volint.xg index 6d5eee1..3c982e5 100644 --- a/src/volser/volint.xg +++ b/src/volser/volint.xg @@ -257,7 +257,7 @@ typedef volintXInfo volXEntries<>; proc CreateVolume( IN afs_int32 partition, - string name<>, + string name, IN afs_int32 type, IN afs_uint32 parent, INOUT afs_uint32 *volid, @@ -291,7 +291,7 @@ proc Clone( IN afs_int32 trans, IN afs_uint32 purgeVol, IN afs_int32 newType, - IN string newName<>, + IN string newName, INOUT afs_uint32 *newVol ) = VOLCLONE; @@ -339,7 +339,7 @@ proc GetStatus( ) = VOLGETSTATUS; proc SignalRestore( - IN string name<>, + IN string name, int type, afs_uint32 pid, afs_uint32 cloneid @@ -357,7 +357,7 @@ proc ListVolumes( proc SetIdsTypes( IN afs_int32 tId, - string name<>, + string name, afs_int32 type, afs_uint32 pId, afs_uint32 cloneId, @@ -369,7 +369,7 @@ proc Monitor( ) = VOLMONITOR; proc PartitionInfo( - IN string name<>, + IN string name<4096>, OUT struct diskPartition *partition ) = VOLDISKPART; @@ -442,7 +442,7 @@ proc DumpV2( ) split = VOLDUMPV2; proc PartitionInfo64( - IN string name<>, + IN string name<4096>, OUT struct diskPartition64 *partition ) = VOLDISKPART64;