Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2016 06:46:54 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297846 - head/sys/amd64/amd64
Message-ID:  <201604120646.u3C6ksib076836@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Apr 12 06:46:54 2016
New Revision: 297846
URL: https://svnweb.freebsd.org/changeset/base/297846

Log:
  [amd64] dtrace_invop handler is to be called only for kernel exceptions
  
  DTrace-related exceptions in userland code are handled elsewhere.
  One practical problem was a crash in dtrace_invop_start() when saved
  %rsp pointed to a virtual address that was not backed.
  
  i386 code already ignored userland exceptions.
  
  Reviewed by: markj, kib
  MFC after:	2 weeks
  Differential Revision: https://reviews.freebsd.org/D5906

Modified:
  head/sys/amd64/amd64/exception.S

Modified: head/sys/amd64/amd64/exception.S
==============================================================================
--- head/sys/amd64/amd64/exception.S	Tue Apr 12 03:55:33 2016	(r297845)
+++ head/sys/amd64/amd64/exception.S	Tue Apr 12 06:46:54 2016	(r297846)
@@ -211,6 +211,8 @@ alltraps_pushregs_no_rdi:
 	 * interrupt. For all other trap types, just handle them in
 	 * the usual way.
 	 */
+	testb	$SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
+	jnz	calltrap		/* ignore userland traps */
 	cmpl	$T_BPTFLT,TF_TRAPNO(%rsp)
 	jne	calltrap
 



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