socsvn commit: r270091 - in soc2013/def/crashdump-head/sys: kern sys
def at FreeBSD.org
def at FreeBSD.org
Thu Jun 26 19:02:21 UTC 2014
Author: def
Date: Thu Jun 26 19:02:20 2014
New Revision: 270091
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=270091
Log:
Don't assume that dump_write is always called with PAGE_SIZE long chunks.
Modified:
soc2013/def/crashdump-head/sys/kern/kern_shutdown.c
soc2013/def/crashdump-head/sys/sys/kerneldump.h
Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c
==============================================================================
--- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Thu Jun 26 17:59:23 2014 (r270090)
+++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Thu Jun 26 19:02:20 2014 (r270091)
@@ -889,8 +889,9 @@
length));
}
- while (length > 0) {
- memcpy(kdb->buf, virtual, KERNELDUMP_BUFFER_SIZE);
+ while (kdb->used + length >= KERNELDUMP_BUFFER_SIZE) {
+ memcpy(kdb->buf + kdb->used, virtual, KERNELDUMP_BUFFER_SIZE -
+ kdb->used);
error = rijndael_blockEncrypt(&kdk->ci, &kdk->ki, kdb->buf,
KERNELDUMP_BUFFER_SIZE * 8, kdb->buf);
@@ -906,10 +907,15 @@
if (error)
return (error);
+ kdb->used = 0;
virtual = (void *)((char *)virtual + KERNELDUMP_BUFFER_SIZE);
length -= KERNELDUMP_BUFFER_SIZE;
offset += KERNELDUMP_BUFFER_SIZE;
}
+ if (length > 0) {
+ memcpy(kdb->buf + kdb->used, virtual, length);
+ kdb->used += length;
+ }
return (0);
}
Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h
==============================================================================
--- soc2013/def/crashdump-head/sys/sys/kerneldump.h Thu Jun 26 17:59:23 2014 (r270090)
+++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Thu Jun 26 19:02:20 2014 (r270091)
@@ -115,6 +115,7 @@
#ifdef _KERNEL
struct kerneldumpbuffer {
uint8_t buf[KERNELDUMP_BUFFER_SIZE]; /* Raw data buffer. */
+ size_t used; /* Number of bytes used in buf. */
off_t kdhoffset; /* Offset value of the first kdh. */
};
More information about the svn-soc-all
mailing list