aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/savecore/savecore.8
Commit message (Collapse)AuthorAgeFilesLines
* Add '-u' switch that would uncompress cores that were compressed byGleb Smirnoff2020-11-191-2/+4
| | | | | | | | | | | | | | | | | | | kernel during dump time. A real life scenario is that cores are compressed to reduce size of dumpon partition, but we either don't care about space in the /var/crash or we have a filesystem level compression of /var/crash. And we want cores to be uncompressed in /var/crash because we'd like to instantily read them with kgdb. In this case we want kernel to write cores compressed, but savecore(1) write them uncompressed. Reviewed by: markj, gallatin Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27245 Notes: svn path=/head/; revision=367824
* Bump .Dd after r331113.Edward Tomasz Napierala2018-03-271-1/+1
| | | | | | | | Reported by: oshogbo@ MFC after: 2 weeks Notes: svn path=/head/; revision=331624
* Xr crashinfo(8) from savecore(8).Edward Tomasz Napierala2018-03-171-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=331113
* Add support for compressed kernel dumps.Mark Johnston2017-10-251-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a kernel built with the GZIO config option, dumpon -z can be used to configure gzip compression using the in-kernel copy of zlib. This is useful on systems with large amounts of RAM, which require a correspondingly large dump device. Recovery of compressed dumps is also faster since fewer bytes need to be copied from the dump device. Because we have no way of knowing the final size of a compressed dump until it is written, the kernel will always attempt to dump when compression is configured, regardless of the dump device size. If the dump is aborted because we run out of space, an error is reported on the console. savecore(8) is modified to handle compressed dumps and save them to vmcore.<index>.gz, as it does when given the -z option. A new rc.conf variable, dumpon_flags, is added. Its value is added to the boot-time dumpon(8) invocation that occurs when a dump device is configured in rc.conf. Reviewed by: cem (earlier version) Discussed with: def, rgrimes Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11723 Notes: svn path=/head/; revision=324965
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add support for encrypted kernel crash dumps.Konrad Witaszczyk2016-12-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes include modifications in kernel crash dump routines, dumpon(8) and savecore(8). A new tool called decryptcore(8) was added. A new DIOCSKERNELDUMP I/O control was added to send a kernel crash dump configuration in the diocskerneldump_arg structure to the kernel. The old DIOCSKERNELDUMP I/O control was renamed to DIOCSKERNELDUMP_FREEBSD11 for backward ABI compatibility. dumpon(8) generates an one-time random symmetric key and encrypts it using an RSA public key in capability mode. Currently only AES-256-CBC is supported but EKCD was designed to implement support for other algorithms in the future. The public key is chosen using the -k flag. The dumpon rc(8) script can do this automatically during startup using the dumppubkey rc.conf(5) variable. Once the keys are calculated dumpon sends them to the kernel via DIOCSKERNELDUMP I/O control. When the kernel receives the DIOCSKERNELDUMP I/O control it generates a random IV and sets up the key schedule for the specified algorithm. Each time the kernel tries to write a crash dump to the dump device, the IV is replaced by a SHA-256 hash of the previous value. This is intended to make a possible differential cryptanalysis harder since it is possible to write multiple crash dumps without reboot by repeating the following commands: # sysctl debug.kdb.enter=1 db> call doadump(0) db> continue # savecore A kernel dump key consists of an algorithm identifier, an IV and an encrypted symmetric key. The kernel dump key size is included in a kernel dump header. The size is an unsigned 32-bit integer and it is aligned to a block size. The header structure has 512 bytes to match the block size so it was required to make a panic string 4 bytes shorter to add a new field to the header structure. If the kernel dump key size in the header is nonzero it is assumed that the kernel dump key is placed after the first header on the dump device and the core dump is encrypted. Separate functions were implemented to write the kernel dump header and the kernel dump key as they need to be unencrypted. The dump_write function encrypts data if the kernel was compiled with the EKCD option. Encrypted kernel textdumps are not supported due to the way they are constructed which makes it impossible to use the CBC mode for encryption. It should be also noted that textdumps don't contain sensitive data by design as a user decides what information should be dumped. savecore(8) writes the kernel dump key to a key.# file if its size in the header is nonzero. # is the number of the current core dump. decryptcore(8) decrypts the core dump using a private RSA key and the kernel dump key. This is performed by a child process in capability mode. If the decryption was not successful the parent process removes a partially decrypted core dump. Description on how to encrypt crash dumps was added to the decryptcore(8), dumpon(8), rc.conf(5) and savecore(8) manual pages. EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64 using QEMU. The feature still has to be tested on arm and arm64 as it wasn't possible to run FreeBSD due to the problems with QEMU emulation and lack of hardware. Designed by: def, pjd Reviewed by: cem, oshogbo, pjd Partial review: delphij, emaste, jhb, kib Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4712 Notes: svn path=/head/; revision=309818
* Add more text to explain --libxo flag.Craig Rodrigues2015-12-011-1/+11
| | | | Notes: svn path=/head/; revision=291607
* Implement -m option to savecore(8) that allows to limit number of kernelPawel Jakub Dawidek2012-12-161-2/+9
| | | | | | | | | | dumps stored. Once the limit is reached it restarts from 0. Reviewed by: avg Obtained from: WHEEL Systems Notes: svn path=/head/; revision=244320
* - When checking if a dump exists on the given device there is no need toPawel Jakub Dawidek2012-12-141-2/+4
| | | | | | | | | | | | | | | | | | | provide dump directory. Eliminate this redundant argument. This changes the usage, but the only risk here is that a warning will be printed about directory given as device. - Update usage of -C option. - When clearing dump header from the given device there is also no need to provide dump directory, although additional arguments for -c were not documented. - Document that -v can be used with -c and that list of devices can be given. Obtained from: WHEEL Systems Notes: svn path=/head/; revision=244218
* Fixed markup.Ruslan Ermilov2009-09-171-3/+5
| | | | Notes: svn path=/head/; revision=197299
* Correct the information about when the respective functionality firstChristian Brueffer2009-04-231-1/+1
| | | | | | | | | | | appeared in FreeBSD. PR: 133785 Submitted by: Ulrich Spoerlein <uqs@spoerlein.net> MFC after: 3 days Notes: svn path=/head/; revision=191414
* Apply various fixes:Tom Rhodes2008-12-241-2/+2
| | | | | | | | | | | | Silence mdoc(7) warnings; Xref correct manual pages; Point user to the ddb.8 manual page. PR: 129398 Submitted by: gavin Notes: svn path=/head/; revision=186478
* Teach savecore(8) how to extract textdump(4) dumps.Robert Watson2007-12-261-0/+11
| | | | | | | | | Update savecore(8) man page to reflect textdump additions. MFC after: 3 months Notes: svn path=/head/; revision=174923
* Markup fixes.Ruslan Ermilov2005-06-141-1/+1
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=147369
* Fix a silly little typo I just spotted.Philip Paeps2005-06-061-1/+1
| | | | Notes: svn path=/head/; revision=147048
* Allow a forced dump even if the dump header information is inconsistent.David E. O'Brien2005-02-241-1/+3
| | | | | | | | | Output more verbosity with additional -v's. Submitted by: seanc Notes: svn path=/head/; revision=142359
* Sort sections.Ruslan Ermilov2005-01-181-2/+2
| | | | Notes: svn path=/head/; revision=140415
* Remove advertising clause from University of California Regent's license,Mark Murray2004-04-091-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core, imp Notes: svn path=/head/; revision=128073
* Add a flag that reports the existence of a dump, and does nothing else.Doug Barton2003-09-041-0/+12
| | | | | | | | | | | The immediate purpose for this option is to use it in rc.d so that we can make savecore behavior conditional. Tremendous assistance with ideas and sanity checking provided by tjr and b@etek.chalmers.se. Notes: svn path=/head/; revision=119734
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-211-2/+2
| | | | Notes: svn path=/head/; revision=102231
* The .Nm utility.Philippe Charnier2002-07-061-1/+1
| | | | Notes: svn path=/head/; revision=99503
* mdoc(7) police: nits.Ruslan Ermilov2002-05-291-8/+21
| | | | Notes: svn path=/head/; revision=97477
* - revert back to vmcore.#Bill Fenner2002-05-051-15/+16
| | | | | | | | | | | | | | | | | - reimplement -z - use syslog() - improve consistancy of messages - allow -f to recover cleared dumps - return bufsize to 1024 * 1024 - return the ability to write sparse files - update man page - fix minfree to require 2k for info file instead of the kernel size - include Berkeley copyright too due to amount of old code copied Submitted by: Chad David <davidc@acns.ab.ca> Notes: svn path=/head/; revision=96049
* Add a Xref to dumpon.Nick Hibma2001-10-281-0/+1
| | | | Notes: svn path=/head/; revision=85629
* mdoc(7) police: restore the correct sorting of SEE ALSO.Ruslan Ermilov2001-09-111-1/+1
| | | | Notes: svn path=/head/; revision=83332
* * Switch from doing compress(1)ed crashdumps with the -z flag to usingKris Kennaway2001-09-061-2/+2
| | | | | | | | | | | | | | gzip(1). gdb doesn't understand these, but then again it didn't understand compressed crashdumps either. * Change a stray lseek() into a Lseek() * Remove the extraneous prototype for log() which has apparently never existed in FreeBSD's sources Obtained from: NetBSD (partially) MFC after: 2 weeks Notes: svn path=/head/; revision=83140
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79530
* Document the new -k option in usage message and man page.Dag-Erling Smørgrav2001-02-161-1/+3
| | | | Notes: svn path=/head/; revision=72542
* Prepare for mdoc(7)NG.Ruslan Ermilov2001-01-161-2/+2
| | | | Notes: svn path=/head/; revision=71099
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-2/+2
| | | | Notes: svn path=/head/; revision=68960
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Correct use of .Nm, add rcsid, remove unused #include.Philippe Charnier1998-07-281-10/+10
| | | | Notes: svn path=/head/; revision=37909
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22990
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Make the savecore command work like the man page says:Bill Fenner1996-10-131-2/+2
| | | | | | | | | | | | | | | | - make minfree work by getting the dump size before checking to see if the dump will fit on the filesystem - also fail to dump if no minfree is specified but there are not enough free blocks. Fix a typo in the man page. Fixes PR bin/1322 Submitted by: "Philippe C." <charnier@lirmm.fr> Notes: svn path=/head/; revision=18914
* Get rid of _PATH_UNIX completely; use getbootfile(3) instead.Garrett Wollman1994-09-241-9/+6
| | | | | | | | | | DANGER WILL ROBINSON! _PATH_UNIX is currently defined as the literal string "don't use this". I am of two minds about this myself, but wanted to get something into the tree as quickly as possible. Notes: svn path=/head/; revision=3041
* Converted 'vmunix' to 'kernel'.David Greenman1994-08-051-4/+4
| | | | Notes: svn path=/head/; revision=1856
* BSD 4.4 Lite sbin SourcesRodney W. Grimes1994-05-261-0/+124
Note: XNSrouted and routed NOT imported here, they shall be imported with usr.sbin. Notes: svn path=/head/; revision=1558