]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-dafs-savestatefe-avoid-overflow-20070902
authorJeffrey Hutzelman <jhutz@cmu.edu>
Mon, 3 Sep 2007 05:00:21 +0000 (05:00 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 3 Sep 2007 05:00:21 +0000 (05:00 +0000)
The problem is that cb_stateSaveFE() overflows an iovec array
on its stack. When it returns, the PC is loaded with garbage and the
process crashes.

(cherry picked from commit edaa34d3a0ea74bffd886ec40e1c13af7c38a4af)

src/viced/callback.c

index 0a8075a8021f6b2c738e3e5e0f6239d2ad5cce04..ebb2c8660d5e06ee503b4c6c65595a62a00f577a 100644 (file)
@@ -2352,8 +2352,8 @@ cb_stateSaveFE(struct fs_dump_state * state, struct FileEntry * fe)
            goto done;
        }
        cbdsk[idx].index = cbi;
-       iov[idx].iov_base = (char *)&cbdsk[idx];
-       len += iov[idx].iov_len = sizeof(struct CBDiskEntry);
+       iov[iovcnt].iov_base = (char *)&cbdsk[idx];
+       len += iov[iovcnt].iov_len = sizeof(struct CBDiskEntry);
        iovcnt++;
        if ((iovcnt == 16) || (!cb->cnext)) {
            if (fs_stateWriteV(state, iov, iovcnt)) {