aboutsummaryrefslogtreecommitdiff
path: root/sbin/dumpon
Commit message (Collapse)AuthorAgeFilesLines
* dumpon(8): Add missing section argumentsGordon Bergling2020-12-281-6/+6
| | | | MFC after: 3 days
* dumpon.8: Update minimum key size languageConrad Meyer2020-04-231-2/+2
| | | | | | | | | | | dumpon(8) has not accepted 1024-bit RSA keys since prior to r339784 (2018-10). The manual page language was not updated at that time (oops). The minimum accepted is 2048 bits, which is also a good default choice. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=360227
* EKCD: Preload error strings, PRNG seed; use OAEP paddingConrad Meyer2020-04-231-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Preload OpenSSL ERR string data so that the formatted error messages are vaguely meaningful. Add OpenSSL error information to the RSA_public_encrypt() operation failure case in one-time key generation. For obsolescent OpenSSL versions (*cough* FIPS *cough*), pre-seed the PRNG before entering Cap mode, as old versions of OpenSSL are unaware of kernel RNG interfaces aside from /dev/random (such as the long-supported kern.arnd, or the slightly more recent getentropy(3) or getrandom(2)). (RSA_public_encrypt() wants a seeded PRNG to randomize the "PS" portion of PKCS 1.5 padding or the "MGF" pseudo-random function in OAEP padding.) Switch dumpon to encrypt the one-time key with OAEP padding (recommended since 1998; RFC2437) rather than the obsolescent PKCS 1.5 padding (1993; RFC2313). Switch decryptcore to attempt OAEP decryption first, and try PKCS 1.5 decryption on failure. This is intended only for transition convenience, and we should obsolete support for non-OAEP padding in a release or two. Reviewed by: markj MFC After: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24534 Notes: svn path=/head/; revision=360226
* dumpon: skip size check if using zstdEric van Gyzen2020-03-031-6/+3
| | | | | | | | | | | | | | | | As with gzip, let the dump device be smaller than physical memory when using zstd and full dumps. Also print the error message if the size check fails, even if -v is not specified. Failing silently is not friendly. Reviewed by: cem markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23923 Notes: svn path=/head/; revision=358594
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-2/+4
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* EKCD: Add Chacha20 encryption modeConrad Meyer2019-05-232-10/+42
| | | | | | | | | | | | | | | | | | | Add Chacha20 mode to Encrypted Kernel Crash Dumps. Chacha20 does not require messages to be multiples of block size, so it is valid to use the cipher on non-block-sized messages without the explicit padding AES-CBC would require. Therefore, allow use with simultaneous dump compression. (Continue to disallow use of AES-CBC EKCD with compression.) dumpon(8) gains a -C cipher flag to select between chacha and aes-cbc. It defaults to chacha if no -C option is provided. The man page documents this behavior. Relnotes: sure Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=348197
* Update the example added in r348082 to specify a dump device priority.Mark Johnston2019-05-221-8/+4
| | | | | | | Event: Waterloo Hackathon 2019 Notes: svn path=/head/; revision=348083
* Provide an example of using dhclient-script(5) to configure netdump.Mark Johnston2019-05-221-1/+44
| | | | | | | | | | Reviewed by: cem MFC after: 1 week Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20345 Notes: svn path=/head/; revision=348082
* List-ify kernel dump device configurationConrad Meyer2019-05-062-62/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users to specify multiple dump configurations in a prioritized list. This enables fallback to secondary device(s) if primary dump fails. E.g., one might configure a preference for netdump, but fallback to disk dump as a second choice if netdump is unavailable. This change does not list-ify netdump configuration, which is tracked separately from ordinary disk dumps internally; only one netdump configuration can be made at a time, for now. It also does not implement IPv6 netdump. savecore(8) is already capable of scanning and iterating multiple devices from /etc/fstab or passed on the command line. This change doesn't update the rc or loader variables 'dumpdev' in any way; it can still be set to configure a single dump device, and rc.d/savecore still uses it as a single device. Only dumpon(8) is updated to be able to configure the more complicated configurations for now. As part of revving the ABI, unify netdump and disk dump configuration ioctl / structure, and leave room for ipv6 netdump as a future possibility. Backwards-compatibility ioctls are added to smooth ABI transition, especially for developers who may not keep kernel and userspace perfectly synced. Reviewed by: markj, scottl (earlier version) Relnotes: maybe Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19996 Notes: svn path=/head/; revision=347192
* Avoid clobbering a user-specified -g value after r340547.Mark Johnston2018-11-201-5/+8
| | | | | | | | CID: 1396919 MFC with: r340547 Notes: svn path=/head/; revision=340686
* Change dumpon(8)'s handling of -g.Mark Johnston2018-11-182-23/+24
| | | | | | | | | | | | | | | Rather than using a special value to denote "use the default router", treat the absence of the -g option to mean the same thing. The in-kernel netdump client will always attempt to reach the server directly before falling back to the configured gateway anyway. This change makes it cleaner to support a hostname value for -g. Reviewed by: cem MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18025 Notes: svn path=/head/; revision=340547
* dumpon.8: Significantly revamp pageConrad Meyer2018-10-261-165/+177
| | | | | | | | | | | | | | | Start with a short summary and cover the options in a standard list style. Organize sections by common focus and prioritize more useful information closer to the top. Flesh out authors, history, caveats, and security considerations sections. Reviewed by: markj, eadler (previous version) Differential Revision: https://reviews.freebsd.org/D17679 Notes: svn path=/head/; revision=339785
* dumpon(8): Provide seatbelt against weak RSA keysConrad Meyer2018-10-262-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | The premise of dumpon -k foo.pem is that dump contents will be confidential except to anyone holding the corresponding RSA private key. This guarantee breaks down when weak RSA keys are used. Small RSA keys (e.g. 512 bits) can be broken on a single personal computer in tractible time. Marginal RSA keys (768 bits) can be broken by EC2 and a few dollars. Even 1024 bit keys can probably be broken by sophisticated and wealthy attackers. NIST SP800-57 (2016) recommends a minimum of 2048 bit RSA keys, and estimates this provides 112 bits of security. It would also be good to protect users from weak values of 'e' (i.e., 3) and perhaps sanity check that their public key .pem does not accidentally contain their private key as well. These considerations are left as future work. Reviewed by: markj, darius AT dons.net.au (previous version) Discussed with: bjk Differential Revision: https://reviews.freebsd.org/D17678 Notes: svn path=/head/; revision=339784
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+2
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* dumpon(8): improve the examples a bitEitan Adler2018-06-131-4/+5
| | | | | | | | | While here, remove extraneous extraneous Pp Reviewed by: jhb (older version) Notes: svn path=/head/; revision=335046
* dumpon(8)Sean Bruno2018-05-291-1/+2
| | | | | | | | | | - fix the WITHOUT_CRYPTO buildworld case. Its rare, but some of us do build this way. Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334357
* dumpon: point to better kernel debug symbols.Eitan Adler2018-05-231-2/+2
| | | | | | | | | | | | The objdir is temporary, and the current example points to GENERIC. Instead point to the installed location of the debug symbols that are supposed to match the kernel you are using. PR: 223993 Submitted by: Trond.Endrestol@ximalas.info Notes: svn path=/head/; revision=334089
* Add netdump support to dumpon(8).Mark Johnston2018-05-062-100/+328
| | | | | | | | | | | | | | | A new usage is added so that parameters for netdump may be specified. Specifically, one configures an interface for netdump with: # dumpon -c <client IP> -s <server IP> [-g <gateway IP>] <iface name> Reviewed by: bdrewery, cem (earlier versions), sbruno MFC after: 1 month Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15254 Notes: svn path=/head/; revision=333284
* Add support for zstd-compressed user and kernel core dumps.Mark Johnston2018-02-132-13/+39
| | | | | | | | | | | | | | | | | | | This works similarly to the existing gzip compression support, but zstd is typically faster and gives better compression ratios. Support for this functionality must be configured by adding ZSTDIO to one's kernel configuration file. dumpon(8)'s new -Z option is used to configure zstd compression for kernel dumps. savecore(8) now recognizes and saves zstd-compressed kernel dumps with a .zst extension. Submitted by: cem (original version) Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13101, https://reviews.freebsd.org/D13633 Notes: svn path=/head/; revision=329240
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add support for compressed kernel dumps.Mark Johnston2017-10-252-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+1
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | 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-103-12/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* dumpon(8) appears to be present in FreeBSD 2.0.5,Sevan Janiyan2016-10-021-2/+2
| | | | | | | | | | | | despite initial import of man page listed FreeBSD 2.1. PR: 212445 Approved by: bcr (mentor) MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D8105 Notes: svn path=/head/; revision=306601
* Use nitems() instead of sizeof(name) / sizeof(*name).Marcelo Araujo2016-04-191-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298244
* Explicitly add more files to the 'runtime' package.Glen Barber2016-02-091-0/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295450
* Fix dumpon compatibility with dumpdev kenvSteven Hartland2015-11-231-4/+19
| | | | | | | | | | | The dumpdev kenv supports devices without the /dev/ prefix, fix dumpon to also support this which is required after r288153. MFC after: 1 week Sponsored by: Multiplay Notes: svn path=/head/; revision=291207
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from head@274682Simon J. Gerraty2014-11-191-3/+13
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=274683
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge from headSimon J. Gerraty2013-09-051-4/+11
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync from headSimon J. Gerraty2012-11-042-3/+50
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Revert r156046. We support setting dumpdev via loader tunable again.Andrey V. Elsukov2014-10-081-3/+13
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Also change default disk name to ada. MFC after: 3 weeks Notes: svn path=/head/; revision=272747
* | | Adapt to the fact that minidumps are now on by default.Joel Dahl2013-04-301-4/+11
| |/ |/| | | | | | | | | | | PR: 177188 Notes: svn path=/head/; revision=250095
* | Document that you can use -v along with -l.Alfred Perlstein2012-11-022-1/+2
| | | | | | | | | | | | | | Noticed by: pjd Notes: svn path=/head/; revision=242486
* | Add an option to display the current dump device via dumpon -l.Alfred Perlstein2012-11-012-3/+49
|/ | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=242451
* Switch the default WARNS level for sbin/ to 6.Ruslan Ermilov2009-10-191-1/+0
| | | | | | | Submitted by: Ulrich Spörlein Notes: svn path=/head/; revision=198236
* Whitespace and style nits.John Baldwin2006-10-311-4/+3
| | | | Notes: svn path=/head/; revision=163852
* With minidumps, the dumping partition could be smaller than physicalPaul Saab2006-04-271-1/+8
| | | | | | | | | memory, so checking the size of the partition is not necessary. Tested by: kris Notes: svn path=/head/; revision=158083
* It has not been possible to specify a dumpdev in loader.conf since 2002,Kris Kennaway2006-02-271-10/+0
| | | | | | | so don't raise false hopes here. Notes: svn path=/head/; revision=156046
* - Mention the size of the additional headerPav Lucistnik2006-01-071-1/+1
| | | | | | | | | PR: docs/85867 Submitted by: dinoex MFC after: 1 week Notes: svn path=/head/; revision=154099
* Sort sections.Ruslan Ermilov2005-01-181-10/+10
| | | | Notes: svn path=/head/; revision=140415