Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Aug 2015 23:02:33 GMT
From:      def@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r289491 - soc2013/def/crashdump-head/sys/kern
Message-ID:  <201508092302.t79N2XZi068145@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: def
Date: Sun Aug  9 23:02:33 2015
New Revision: 289491
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289491

Log:
  Use dumperinfo.kdk instead of kerneldumpcrypto.kdc_enable to verify if EKCD is enabled.

Modified:
  soc2013/def/crashdump-head/sys/kern/kern_shutdown.c

Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c
==============================================================================
--- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c	Sun Aug  9 22:33:51 2015	(r289490)
+++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c	Sun Aug  9 23:02:33 2015	(r289491)
@@ -143,7 +143,6 @@
 MALLOC_DEFINE(M_KDK, "kerneldumpkey", "Kernel dump key structure");
 
 static struct kerneldumpcrypto {
-	int		kdc_enable;
 	uint8_t		kdc_key[KERNELDUMP_KEY_SIZE];
 	uint8_t		kdc_iv[KERNELDUMP_IV_SIZE];
 	keyInstance	kdc_ki;
@@ -881,23 +880,19 @@
 	kdc->kdc_lastoffset = 0;
 	kdc->kdc_lastlength = 0;
 
-	di->kdc = kdc;
-	di->kdk = kdk;
-
 	return (0);
 }
 
 static int
 kerneldump_sysctl_enable(SYSCTL_HANDLER_ARGS)
 {
-	int error;
+	int enable, error;
 
-	error = sysctl_handle_opaque(oidp, &dumpcrypto.kdc_enable,
-	    sizeof(dumpcrypto.kdc_enable), req);
+	error = sysctl_handle_opaque(oidp, &enable, sizeof(enable), req);
 	if (error != 0)
 		return (error);
 
-	if (dumpcrypto.kdc_enable == 1)
+	if (enable == 1)
 		dumper.kdk = dumpkey;
 	else
 		dumper.kdk = NULL;
@@ -1099,7 +1094,7 @@
 {
 
 #ifdef EKCD
-	if (di->kdc->kdc_enable == 1) {
+	if (di->kdk != NULL) {
 		return (dump_encrypted_write(di, virtual, physical, offset,
 		    length));
 	}



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