socsvn commit: r257595 - in soc2013/def/crashdump-head/sys: kern sys

def at FreeBSD.org def at FreeBSD.org
Sun Sep 22 01:46:00 UTC 2013


Author: def
Date: Sun Sep 22 01:45:56 2013
New Revision: 257595
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257595

Log:
  Define a sysctl variable for a kernel crash dump key.

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

Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c
==============================================================================
--- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c	Sun Sep 22 00:54:22 2013	(r257594)
+++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c	Sun Sep 22 01:45:56 2013	(r257595)
@@ -137,6 +137,13 @@
 SYSCTL_INT(_kern_shutdown, OID_AUTO, show_busybufs, CTLFLAG_RW,
 	&show_busybufs, 0, "");
 
+static struct kerneldumpkey dumperkey;
+static struct kerneldumpbuffer dumperbuffer;
+#ifdef ENCRYPT_CRASH
+SYSCTL_STRUCT(_kern, OID_AUTO, dumpkey, CTLFLAG_RW, &dumperkey,
+	kerneldumpkey, "Kernel crash dump key");
+#endif
+
 /*
  * Variable panicstr contains argument to first call to panic; used as flag
  * to indicate that the kernel has already called panic.
@@ -146,8 +153,6 @@
 int dumping;				/* system is dumping */
 int rebooting;				/* system is rebooting */
 static struct dumperinfo dumper;	/* our selected dumper */
-static struct kerneldumpkey dumperkey;
-static struct kerneldumpbuffer dumperbuffer;
 
 /* Context information for dump-debuggers. */
 static struct pcb dumppcb;		/* Registers. */

Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h
==============================================================================
--- soc2013/def/crashdump-head/sys/sys/kerneldump.h	Sun Sep 22 00:54:22 2013	(r257594)
+++ soc2013/def/crashdump-head/sys/sys/kerneldump.h	Sun Sep 22 01:45:56 2013	(r257595)
@@ -77,6 +77,7 @@
 #define	KERNELDUMP_SPARC64_VERSION	1
 #define	KERNELDUMP_TEXT_VERSION		1
 #define	KERNELDUMP_KEY_SIZE		32
+#define	KERNELDUMP_ENCRYPTED_KEY_SIZE	256
 #define	KERNELDUMP_TWEAK_SIZE		8
 	uint64_t	dumplength;		/* excl headers */
 	uint64_t	dumptime;
@@ -108,6 +109,15 @@
 	return (parity);
 }
 
+struct kerneldumpkey {
+	int		keysize;
+	char		key[KERNELDUMP_KEY_SIZE];
+	char		encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE];
+	char		tweak[KERNELDUMP_TWEAK_SIZE];
+	struct xts_ctx	data_ctx;
+	struct xts_ctx	tweak_ctx;
+};
+
 #ifdef _KERNEL
 /*
  * Constant key for kernel crash dumps.
@@ -122,14 +132,6 @@
 	0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41
 };
 
-struct kerneldumpkey {
-	int		keysize;
-	char		key[KERNELDUMP_KEY_SIZE];
-	char		tweak[KERNELDUMP_TWEAK_SIZE];
-	struct xts_ctx	data_ctx;
-	struct xts_ctx	tweak_ctx;
-};
-
 struct kerneldumpbuffer {
 #define	KERNELDUMP_DEVBLK_SIZE	512
 #define	KERNELDUMP_SECTOR_SIZE	4096


More information about the svn-soc-all mailing list