svn commit: r330132 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64

John Baldwin jhb at FreeBSD.org
Wed Feb 28 22:33:08 UTC 2018


Author: jhb
Date: Wed Feb 28 22:33:07 2018
New Revision: 330132
URL: https://svnweb.freebsd.org/changeset/base/330132

Log:
  MFC 328610: Ensure 'name' is not NULL before passing to strcmp().
  
  This avoids a nested page fault when obtaining a stack trace in DDB if
  the address from the first frame does not resolve to a known symbol.

Modified:
  stable/10/sys/amd64/amd64/db_trace.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/amd64/amd64/db_trace.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/amd64/amd64/db_trace.c
==============================================================================
--- stable/10/sys/amd64/amd64/db_trace.c	Wed Feb 28 21:51:51 2018	(r330131)
+++ stable/10/sys/amd64/amd64/db_trace.c	Wed Feb 28 22:33:07 2018	(r330132)
@@ -335,7 +335,8 @@ db_backtrace(struct thread *td, struct trapframe *tf, 
 					/* Probably an assembler symbol. */
 					actframe = (void *)(tf->tf_rsp - 8);
 				}
-			} else if (strcmp(name, "fork_trampoline") == 0) {
+			} else if (name != NULL &&
+			    strcmp(name, "fork_trampoline") == 0) {
 				/*
 				 * Don't try to walk back on a stack for a
 				 * process that hasn't actually been run yet.


More information about the svn-src-stable-10 mailing list