Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/kerneldump.h
Context not available. | |||||
#ifndef _SYS_KERNELDUMP_H | #ifndef _SYS_KERNELDUMP_H | ||||
#define _SYS_KERNELDUMP_H | #define _SYS_KERNELDUMP_H | ||||
#include <sys/param.h> | |||||
#include <sys/conf.h> | |||||
#include <machine/endian.h> | #include <machine/endian.h> | ||||
#if BYTE_ORDER == LITTLE_ENDIAN | #if BYTE_ORDER == LITTLE_ENDIAN | ||||
Context not available. | |||||
#define htod64(x) (x) | #define htod64(x) (x) | ||||
#endif | #endif | ||||
#define KERNELDUMP_ENC_NONE 0 | |||||
#define KERNELDUMP_ENC_AES_256_CBC 1 | |||||
#define KERNELDUMP_BLOCK_SIZE 512 | |||||
#define KERNELDUMP_IV_MAX_SIZE 32 | |||||
#define KERNELDUMP_KEY_MAX_SIZE 64 | |||||
#define KERNELDUMP_ENCKEY_MAX_SIZE (16384 / 8) | |||||
/* | /* | ||||
* All uintX_t fields are in dump byte order, which is the same as | * All uintX_t fields are in dump byte order, which is the same as | ||||
* network byte order. Use the macros defined above to read or | * network byte order. Use the macros defined above to read or | ||||
Context not available. | |||||
#define KERNELDUMPMAGIC_CLEARED "Cleared Kernel Dump" | #define KERNELDUMPMAGIC_CLEARED "Cleared Kernel Dump" | ||||
char architecture[12]; | char architecture[12]; | ||||
uint32_t version; | uint32_t version; | ||||
#define KERNELDUMPVERSION 1 | #define KERNELDUMPVERSION 2 | ||||
jhb: You should bump KERNELDUMPVERSION. Since you change the layout of the header, old savecore… | |||||
Done Inline ActionsI've bumped both KERNELDUMPVERSION and KERNELDUMP_TEXT_VERSION for this review. I'll move KERNELDUMP_TEXT_VERSION in a separate commit. def: I've bumped both KERNELDUMPVERSION and KERNELDUMP_TEXT_VERSION for this review. I'll move… | |||||
#define KERNELDUMP_TEXT_VERSION 2 | |||||
uint32_t architectureversion; | uint32_t architectureversion; | ||||
#define KERNELDUMP_AARCH64_VERSION 1 | #define KERNELDUMP_AARCH64_VERSION 1 | ||||
#define KERNELDUMP_AMD64_VERSION 2 | #define KERNELDUMP_AMD64_VERSION 2 | ||||
Context not available. | |||||
#define KERNELDUMP_MIPS_VERSION 1 | #define KERNELDUMP_MIPS_VERSION 1 | ||||
#define KERNELDUMP_POWERPC_VERSION 1 | #define KERNELDUMP_POWERPC_VERSION 1 | ||||
#define KERNELDUMP_SPARC64_VERSION 1 | #define KERNELDUMP_SPARC64_VERSION 1 | ||||
#define KERNELDUMP_TEXT_VERSION 1 | |||||
uint64_t dumplength; /* excl headers */ | uint64_t dumplength; /* excl headers */ | ||||
uint64_t dumptime; | uint64_t dumptime; | ||||
uint32_t dumpkeysize; | |||||
uint32_t blocksize; | uint32_t blocksize; | ||||
char hostname[64]; | char hostname[64]; | ||||
char versionstring[192]; | char versionstring[192]; | ||||
char panicstring[192]; | char panicstring[188]; | ||||
uint32_t parity; | uint32_t parity; | ||||
}; | }; | ||||
struct kerneldumpkey { | |||||
uint8_t kdk_encryption; | |||||
uint8_t kdk_iv[KERNELDUMP_IV_MAX_SIZE]; | |||||
uint32_t kdk_encryptedkeysize; | |||||
uint8_t kdk_encryptedkey[]; | |||||
}; | |||||
/* | /* | ||||
* Parity calculation is endian insensitive. | * Parity calculation is endian insensitive. | ||||
*/ | */ | ||||
Context not available. | |||||
vm_paddr_t pa_size; | vm_paddr_t pa_size; | ||||
}; | }; | ||||
int kerneldumpcrypto_init(struct kerneldumpcrypto *kdc); | |||||
uint32_t kerneldumpcrypto_dumpkeysize(const struct kerneldumpcrypto *kdc); | |||||
void mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, | void mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, | ||||
uint64_t dumplen, uint32_t blksz); | uint64_t dumplen, uint32_t dumpkeysize, uint32_t blksz); | ||||
int dumpsys_generic(struct dumperinfo *); | int dumpsys_generic(struct dumperinfo *); | ||||
Context not available. | |||||
typedef int dumpsys_callback_t(struct dump_pa *, int, void *); | typedef int dumpsys_callback_t(struct dump_pa *, int, void *); | ||||
int dumpsys_foreach_chunk(dumpsys_callback_t, void *); | int dumpsys_foreach_chunk(dumpsys_callback_t, void *); | ||||
int dumpsys_cb_dumpdata(struct dump_pa *, int, void *); | int dumpsys_cb_dumpdata(struct dump_pa *, int, void *); | ||||
int dumpsys_buf_seek(struct dumperinfo *, size_t); | |||||
int dumpsys_buf_write(struct dumperinfo *, char *, size_t); | int dumpsys_buf_write(struct dumperinfo *, char *, size_t); | ||||
int dumpsys_buf_flush(struct dumperinfo *); | int dumpsys_buf_flush(struct dumperinfo *); | ||||
Context not available. |
You should bump KERNELDUMPVERSION. Since you change the layout of the header, old savecore binaries will try to handle it and get it wrong. Bumping the version means they will ignore it instead. You will also need to bump KERNELDUMP_TEXT_VERSION (which is not an architecture version as the header seems to imply; looking in savecore's sources it is checked from 'version' so it should also be moved up here, probably in a separate commit before this).