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.
_______________________________________________
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