svn commit: r354734 - stable/12/sys/kern

Ed Maste emaste at FreeBSD.org
Fri Nov 15 16:40:11 UTC 2019


Author: emaste
Date: Fri Nov 15 16:40:10 2019
New Revision: 354734
URL: https://svnweb.freebsd.org/changeset/base/354734

Log:
  MFC r354228: 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.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sys/kern/imgact_elf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/imgact_elf.c
==============================================================================
--- stable/12/sys/kern/imgact_elf.c	Fri Nov 15 16:34:35 2019	(r354733)
+++ stable/12/sys/kern/imgact_elf.c	Fri Nov 15 16:40:10 2019	(r354734)
@@ -2233,7 +2233,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-stable mailing list