Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2018 23:29:27 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328610 - head/sys/amd64/amd64
Message-ID:  <201801302329.w0UNTRHn080138@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Jan 30 23:29:27 2018
New Revision: 328610
URL: https://svnweb.freebsd.org/changeset/base/328610

Log:
  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.
  
  MFC after:	1 week
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/amd64/amd64/db_trace.c

Modified: head/sys/amd64/amd64/db_trace.c
==============================================================================
--- head/sys/amd64/amd64/db_trace.c	Tue Jan 30 23:20:41 2018	(r328609)
+++ head/sys/amd64/amd64/db_trace.c	Tue Jan 30 23:29:27 2018	(r328610)
@@ -336,7 +336,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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801302329.w0UNTRHn080138>