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 <ivansprun...@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));
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to