mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 21:47:45 +00:00
volser: Check vnode length on dump
Commit aadf69eabb1962496fa93745ab560a5b48cacd61 adds length checks on vnodes during fileserver read/write operations. Do the same thing when we dump volume data from the volserver, to ensure that we don't transmit incorrect data e.g. to other RO sites when releasing. FIXES 131530 Change-Id: I662489d0466d38af74a9604a2c97a4a5c72525c7 Reviewed-on: http://gerrit.openafs.org/8836 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
parent
75d9c88281
commit
eb938bd18d
@ -1080,6 +1080,7 @@ DumpVnode(struct iod *iodp, struct VnodeDiskObject *v, int volid,
|
|||||||
VAclDiskSize(v));
|
VAclDiskSize(v));
|
||||||
}
|
}
|
||||||
if (VNDISK_GET_INO(v)) {
|
if (VNDISK_GET_INO(v)) {
|
||||||
|
afs_sfsize_t indexlen, disklen;
|
||||||
IH_INIT(ihP, iodp->device, iodp->parentId, VNDISK_GET_INO(v));
|
IH_INIT(ihP, iodp->device, iodp->parentId, VNDISK_GET_INO(v));
|
||||||
fdP = IH_OPEN(ihP);
|
fdP = IH_OPEN(ihP);
|
||||||
if (fdP == NULL) {
|
if (fdP == NULL) {
|
||||||
@ -1087,6 +1088,17 @@ DumpVnode(struct iod *iodp, struct VnodeDiskObject *v, int volid,
|
|||||||
IH_RELEASE(ihP);
|
IH_RELEASE(ihP);
|
||||||
return VOLSERREAD_DUMPERROR;
|
return VOLSERREAD_DUMPERROR;
|
||||||
}
|
}
|
||||||
|
VNDISK_GET_LEN(indexlen, v);
|
||||||
|
disklen = FDH_SIZE(fdP);
|
||||||
|
if (indexlen != disklen) {
|
||||||
|
FDH_REALLYCLOSE(fdP);
|
||||||
|
IH_RELEASE(ihP);
|
||||||
|
Log("DumpVnode: volume %lu vnode %lu has inconsistent length "
|
||||||
|
"(index %lu disk %lu); aborting dump\n",
|
||||||
|
(unsigned long)volid, (unsigned long)vnodeNumber,
|
||||||
|
(unsigned long)indexlen, (unsigned long)disklen);
|
||||||
|
return VOLSERREAD_DUMPERROR;
|
||||||
|
}
|
||||||
code = DumpFile(iodp, vnodeNumber, fdP);
|
code = DumpFile(iodp, vnodeNumber, fdP);
|
||||||
FDH_CLOSE(fdP);
|
FDH_CLOSE(fdP);
|
||||||
IH_RELEASE(ihP);
|
IH_RELEASE(ihP);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user