From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 01:46:00 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2F94C92 for ; Sun, 22 Sep 2013 01:46:00 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85F10237E for ; Sun, 22 Sep 2013 01:46:00 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8M1k02g075124 for ; Sun, 22 Sep 2013 01:46:00 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8M1k0ph075121 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 01:46:00 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 01:46:00 GMT Message-Id: <201309220146.r8M1k0ph075121@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257595 - in soc2013/def/crashdump-head/sys: kern sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 01:46:00 -0000 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