Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2016 13:44:03 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303913 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <201608101344.u7ADi3J0076139@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Aug 10 13:44:03 2016
New Revision: 303913
URL: https://svnweb.freebsd.org/changeset/base/303913

Log:
  Unconditionally perform checks that FPU region was entered, when #NM
  exception is caught in kernel mode.  There are third-party modules
  which trigger the issue, and since the problem causes usermode state
  corruption at least, panic in production kernels as well.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/i386/i386/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Wed Aug 10 13:38:44 2016	(r303912)
+++ head/sys/amd64/amd64/trap.c	Wed Aug 10 13:44:03 2016	(r303913)
@@ -443,8 +443,8 @@ trap(struct trapframe *frame)
 			goto out;
 
 		case T_DNA:
-			KASSERT(!PCB_USER_FPU(td->td_pcb),
-			    ("Unregistered use of FPU in kernel"));
+			if (PCB_USER_FPU(td->td_pcb))
+				panic("Unregistered use of FPU in kernel");
 			fpudna();
 			goto out;
 

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Wed Aug 10 13:38:44 2016	(r303912)
+++ head/sys/i386/i386/trap.c	Wed Aug 10 13:44:03 2016	(r303913)
@@ -540,8 +540,8 @@ trap(struct trapframe *frame)
 
 		case T_DNA:
 #ifdef DEV_NPX
-			KASSERT(!PCB_USER_FPU(td->td_pcb),
-			    ("Unregistered use of FPU in kernel"));
+			if (PCB_USER_FPU(td->td_pcb))
+				panic("Unregistered use of FPU in kernel");
 			if (npxdna())
 				goto out;
 #endif



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