svn commit: r354228 - head/sys/kern
Ed Maste
emaste at FreeBSD.org
Thu Oct 31 20:42:37 UTC 2019
Author: emaste
Date: Thu Oct 31 20:42:36 2019
New Revision: 354228
URL: https://svnweb.freebsd.org/changeset/base/354228
Log:
avoid kernel stack data leak in core dump thrmisc note
bzero the entire thrmisc struct, not just the padding. Other core dump
notes are already done this way.
Reported by: Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by: markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Modified:
head/sys/kern/imgact_elf.c
Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c Thu Oct 31 20:37:19 2019 (r354227)
+++ head/sys/kern/imgact_elf.c Thu Oct 31 20:42:36 2019 (r354228)
@@ -2229,7 +2229,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_
td = (struct thread *)arg;
if (sb != NULL) {
KASSERT(*sizep == sizeof(thrmisc), ("invalid size"));
- bzero(&thrmisc._pad, sizeof(thrmisc._pad));
+ bzero(&thrmisc, sizeof(thrmisc));
strcpy(thrmisc.pr_tname, td->td_name);
sbuf_bcat(sb, &thrmisc, sizeof(thrmisc));
}
More information about the svn-src-all
mailing list