summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Pospisil <Marek.Pospisil@Sun.COM>2010-03-22 03:32:52 -0700
committerMarek Pospisil <Marek.Pospisil@Sun.COM>2010-03-22 03:32:52 -0700
commit5562c04e117f4abfdf08adce7adbc97a3e37758b (patch)
treeae91416c3536d647e536a682d5b0058de02e64d9
parent0749e8de8370b977962d1cbaa31a8ebbaf755a01 (diff)
downloadillumos-joyent-5562c04e117f4abfdf08adce7adbc97a3e37758b.tar.gz
6932958 kernel heap corruption detected panic while running zoneadm
-rw-r--r--usr/src/uts/common/c2/audit_io.c8
-rw-r--r--usr/src/uts/common/os/audit_zone.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/usr/src/uts/common/c2/audit_io.c b/usr/src/uts/common/c2/audit_io.c
index 4d6cc3f7c3..ad1f083c8c 100644
--- a/usr/src/uts/common/c2/audit_io.c
+++ b/usr/src/uts/common/c2/audit_io.c
@@ -642,14 +642,16 @@ au_doorio(au_kcontext_t *kctx) {
* Initial allocation is from audit_start.c/audit_init()
*/
if (kctx->auk_queue.bufsz != kctx->auk_queue.buflen) {
+ size_t new_sz = kctx->auk_queue.bufsz;
+
kmem_free(kctx->auk_dbuffer, AU_DBUF_HEADER +
kctx->auk_queue.buflen);
- kctx->auk_dbuffer = kmem_alloc(AU_DBUF_HEADER +
- kctx->auk_queue.bufsz, KM_SLEEP);
+ kctx->auk_dbuffer = kmem_alloc(AU_DBUF_HEADER + new_sz,
+ KM_SLEEP);
/* omit the 64 bit header */
- kctx->auk_queue.buflen = kctx->auk_queue.bufsz;
+ kctx->auk_queue.buflen = new_sz;
}
if (!kctx->auk_queue.head)
goto nodata;
diff --git a/usr/src/uts/common/os/audit_zone.c b/usr/src/uts/common/os/audit_zone.c
index a42f4e6ee2..c8026d062a 100644
--- a/usr/src/uts/common/os/audit_zone.c
+++ b/usr/src/uts/common/os/audit_zone.c
@@ -141,7 +141,7 @@ au_zone_destroy(zoneid_t zone, void *arg)
cv_destroy(&(kctx->auk_queue.write_cv));
cv_destroy(&(kctx->auk_queue.read_cv));
- kmem_free(kctx->auk_dbuffer, AU_DBUF_HEADER + kctx->auk_queue.bufsz);
+ kmem_free(kctx->auk_dbuffer, AU_DBUF_HEADER + kctx->auk_queue.buflen);
kmem_free(kctx, sizeof (au_kcontext_t));
}