⬢ DragonFlyBSD Kernel Audit
DF-5556 / fix.diff
← back to finding ↓ download raw
--- sys/platform/vkernel64/include/globaldata.h
+++ sys/platform/vkernel64/include/globaldata.h
@@ -82,6 +82,7 @@ struct mdglobaldata {
 	u_int		unused003;
 	cpumask_t	unused004;
 	u_int		gd_ss_eflags;
+	union savefpu	gd_zerofpu;	/* zeroed FPU image for security wipe */
 };
 
 #define MDGLOBALDATA_BASEALLOC_SIZE	\
--- sys/platform/vkernel64/x86_64/npx.c
+++ sys/platform/vkernel64/x86_64/npx.c
@@ -252,9 +252,11 @@ npxsave(union savefpu *addr)
 	crit_enter();
 	/*stop_emulating();*/
 	fpusave(addr, 0);
 	mdcpu->gd_npxthread = NULL;
 	fninit();
+	fpurstor(&mdcpu->gd_zerofpu, 0);	/* security wipe */
 	/*start_emulating();*/
 	crit_exit();
 }
 
 void