summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Remove old ioctl use and support, once and for all.imp2015-01-062-125/+2
|
* Remove support for FreeBSD 7 and really old FreeBSD 8. The classifiersimp2014-12-205-435/+12
| | | | | | | | | have been in the base for a while, so the gymnastics here aren't needed. In addition, the bugs in subr_disk.c have been fixed since 2009, so there's no need for an identical copy of it in the tree anymore. There's really no need to binary patch g_io_request, so let's get rid of the code (not compiled in anymore) lest others think it is a good idea.
* Add some new modes to OpenCrypto. These modes are AES-ICM (can be usedjmg2014-12-123-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for counter mode), and AES-GCM. Both of these modes have been added to the aesni module. Included is a set of tests to validate that the software and aesni module calculate the correct values. These use the NIST KAT test vectors. To run the test, you will need to install a soon to be committed port, nist-kat that will install the vectors. Using a port is necessary as the test vectors are around 25MB. All the man pages were updated. I have added a new man page, crypto.7, which includes a description of how to use each mode. All the new modes and some other AES modes are present. It would be good for someone else to go through and document the other modes. A new ioctl was added to support AEAD modes which AES-GCM is one of them. Without this ioctl, it is not possible to test AEAD modes from userland. Add a timing safe bcmp for use to compare MACs. Previously we were using bcmp which could leak timing info and result in the ability to forge messages. Add a minor optimization to the aesni module so that single segment mbufs don't get copied and instead are updated in place. The aesni module needs to be updated to support blocked IO so segmented mbufs don't have to be copied. We require that the IV be specified for all calls for both GCM and ICM. This is to ensure proper use of these functions. Obtained from: p4: //depot/projects/opencrypto Relnotes: yes Sponsored by: FreeBSD Foundation Sponsored by: NetGate
* Avoid unneeded malloc/memcpy/free if there is no metadata on disk.mav2014-12-052-10/+12
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
* Decode some binary fields of Intel metadata.mav2014-12-041-8/+115
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
* Actually, that was a bad idea. Go back to MAXPARTITIONS.imp2014-11-201-1/+1
| | | | Submitted by: bruce
* The number of BSD partitions is variable. Return the proper numberimp2014-11-191-1/+1
| | | | | | (which is in basetable->gpt_entries). Submitted by: ae@
* Implement the historic DIOCGDINFO ioctl for gpart on BSDimp2014-11-183-1/+75
| | | | | | | partitions. Several utilities still use this interface and require additional information since gpart was activated than before. This allows fsck of a UFS partition without having to specify it is UFS, per historic behavior.
* Add missing privilege check when setting the dump device. Before that change itpjd2014-11-111-7/+7
| | | | | | | | | | | | was possible for a regular user to setup the dump device if he had write access to the given device. In theory it is a security issue as user might get access to kernel's memory after provoking kernel crash, but in practise it is not recommended to give regular users direct access to storage devices. Rework the code so that we do privileges check within the set_dumper() function to avoid similar problems in the future. Discussed with: secteam
* Constify the AES code and propagate to consumers. This allows us todes2014-11-101-3/+3
| | | | | | update the Fortuna code to use SHAd-256 as defined in FS&K. Approved by: so (self)
* Translate the errno to gctl_error() texts.phk2014-11-091-0/+17
| | | | Spotted by: mwlucas
* Add to CTL support for logical block provisioning threshold notifications.mav2014-11-061-0/+10
| | | | | | | | For ZVOL-backed LUNs this allows to inform initiators if storage's used or available spaces get above/below the configured thresholds. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* Revert somewhat hackish geom_disk optimization, committed as part of r256880,mav2014-10-251-41/+16
| | | | | | | | | | | | | and the following r273143 commit, supposed to workaround introduced issue by quite innocent-looking change. While there is no clear understanding why, but r273143 is accused in data corruption in some environments with high I/O load. I personally don't see any problem in that commit, and possibly it is just a trigger to some other bug somewhere, but better safe then sorry for now. Requested by: scottl@ MFC after: 3 days
* Populate the GELI passphrase cache with the kern.geom.eli.passphrasecperciva2014-10-221-0/+19
| | | | | | | | | | | | variable (if any) provided in the boot environment. Unset it from the kernel environment after doing this, so that the passphrase is no longer present in kernel memory once we enter userland. This will make it possible to provide a GELI passphrase via the boot loader; FreeBSD's loader does not yet do this, but GRUB (and PCBSD) will have support for this soon. Tested by: kmoore
* Fix multiple incorrect SYSCTL arguments in the kernel:hselasky2014-10-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies
* Add provider's sectorsize and stripesize to confdot output.ae2014-10-171-2/+3
| | | | Submitted by: rpokala at panasas.com
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-10-163-5/+5
| | | | | | | | in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe
* Add an ability to set dumpdev via loader(8) tunable.ae2014-10-081-14/+62
| | | | MFC after: 3 weeks
* Fix a bug in r272297 which prevented dumpdev from setting.hrs2014-10-031-1/+1
| | | | !u is not equivalent to (u != 0).
* Be prepared that set_dumper() might fail even when resetting it or prefixpjd2014-09-301-3/+2
| | | | | the call with (void) to document that we intentionally ignore the return value - no way to handle an error in case of device disappearing.
* Style fixes.pjd2014-09-301-10/+8
|
* Cache GELI passphrases entered at the console during the boot process,cperciva2014-09-161-7/+38
| | | | | | | | | | | | | | | | | | | in order to improve user-friendliness when a system has multiple disks encrypted using the same passphrase. When examining a new GELI provider, the most recently used passphrase will be attempted before prompting for a passphrase; and whenever a passphrase is entered, it is cached for later reference. When the root disk is mounted, the cached passphrase is zeroed (triggered by the "mountroot" event), in order to minimize the possibility of leakage of passphrases. (After root is mounted, the "taste and prompt for passphrases on the console" code path is disabled, so there is no potential for a passphrase to be stored after the zeroing takes place.) This behaviour can be disabled by setting kern.geom.eli.boot_passcache=0. Reviewed by: pjd, dteske, allanjude MFC after: 7 days
* Add device name used in geom_map verbose output. This helps when usingsbruno2014-09-111-4/+4
| | | | | | | | geom_map with multiple flash/spi devices. Phabric: https://reviews.freebsd.org/D766 Reviewed by: adrian MFC after: 2 weeks
* use a straight buffer instead of an iov w/ 1 segment... The aesnijmg2014-09-043-56/+10
| | | | | | | | | driver when it hits a mbuf/iov buffer, it mallocs and copies the data for processing.. This improves perf by ~8-10% on my machine... I have thoughts of fixing AES-NI so that it can better handle segmented buffers, which should help improve IPSEC performance, but that is for the future...
* Deal explicitly with possible failures of make_dev_alias_p() in GEOM.scottl2014-08-181-3/+5
| | | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> MFC after: 3 days
* Turn off kern.geom.part.mbr.enforce_chs by default.ae2014-08-121-2/+2
|
* Add sysctl and loader tunable kern.geom.part.mbr.enforce_chs that is setae2014-08-121-0/+10
| | | | | | | | by default. It can be used to disable automatic alignment to CHS geometry, that GEOM_PART_MBR does. Reviewed by: wblock MFC after: 1 week
* cswitch is unsigned, so don't compare it < 0. Any negative numbersimp2014-08-071-1/+1
| | | | will look huge and be caught by > 100.
* Unsigned values can never be less than 0.imp2014-08-071-1/+1
|
* In r264504, we prevented doing I/O for more than MAXPHYS by makingmarcel2014-07-221-158/+177
| | | | | | | | | | | | the assumption that consumers would respect bio_completed and/or bio_resid to detect short reads. This assumption proved false and file corruption was the result. Create as many bios as we need to satisfy the original request. Check the cached chunk every time we need to do I/O to increase the hit rate. Obtained from: junipre Networks, Inc. MFC after: 1 week
* After EFI support was added to the installer, it needed to allow bootnwhitehorn2014-07-045-6/+5
| | | | | | | | | | | | | partitions of types other than "freebsd-boot" (in particular, "efi"). This allows the removal of some nasty hacks for supporting PowerPC systems, in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific code on MBR. This changes the installer to use the correct names, which also breaks a degeneracy in the meaning of "freebsd-boot" that allows the addition of support for some newer IBM systems that can boot from GPT in addition to MBR. Since I have no idea how to detect which those systems are, leave the default on IBM PPC systems as MBR for now.
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-2822-141/+60
|
* Revert r267961, r267973:gjb2014-06-2722-60/+141
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-2722-141/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Add disklabel64 support to GEOM_PART class.ae2014-06-111-0/+667
| | | | | | | | | | | | | | This partitioning scheme is used in DragonFlyBSD. It is similar to BSD disklabel, but has the following improvements: * metadata has own dedicated place and isn't accessible through partitions; * all offsets are 64-bit; * supports 16 partitions by default (has reserved place for more); * has reserved place for backup label (but not yet implemented); * has UUIDs for partitions and partition types; No objections from: geom MFC after: 2 weeks Relnotes: yes
* Allow swapping to DragonFlyBSD's swap partition.ae2014-06-111-1/+2
| | | | MFC after: 2 weeks
* Add aliases for DragonFlyBSD's partition types.ae2014-06-114-24/+57
| | | | MFC after: 2 weeks
* - Fix the keyfile being cleared prematurely after r259428brd2014-06-061-1/+1
| | | | | | PR: 185084 Submitted by: fk@fabiankeil.de Reviewed by: pjd@
* Use g_conf_printf_escaped() to escape symbols, which can breakae2014-05-303-8/+16
| | | | | | an XML tree. MFC after: 1 week
* Add a topology trace to the g_spoil_event.ae2014-05-191-0/+2
| | | | MFC after: 1 week
* We have two functions from where a geom orphan method could be called:ae2014-05-191-0/+8
| | | | | | | | | | | g_orphan_register and g_resize_provider_event. Both are called from the event queue. Also we have GEOM_DEV class, which does deferred destroy for its consumers via g_dev_destroy (also called from the event queue). So it is possible, that for some consumers an orphan method will be called twice. This triggers panic in g_dev_orphan. Check that consumer isn't already orphaned before call orphan method. MFC after: 2 weeks
* Make GEOM DISK to account also BIO_FLUSH operations.mav2014-05-171-2/+5
|
* It is safe to allow shrinking, when aligned size is bigger than current.ae2014-05-073-4/+4
| | | | | Tested by: jmg MFC after: 1 week
* Make r242379 - the fix for UFS labels disappearing after resizingtrasz2014-05-051-2/+4
| | | | | | | | the provider - also apply to UFS1 filesystems. This should help with resizing filesystems created by makefs(8), which still uses UFS1. Tested by: jmg@ Sponsored by: The FreeBSD Foundation
* Add an advice what to do when partition was automatically resized.ae2014-05-041-2/+4
| | | | X-MFC after: r256690
* Add better error description for case when we are doing resize andae2014-05-041-1/+3
| | | | | | scheme-specific method returns EBUSY. MFC after: 1 week
* Prevent an unexpected shrinking on resizing due to alignment for MBR,ae2014-05-043-3/+18
| | | | | | | PC98 and VTOC8 schemes. Reported by: jmg MFC after: 1 week
* For schemes that do an automatic partition aligning move this code toae2014-05-044-80/+93
| | | | | | separate function. MFC after: 1 week
* Fix a leak in g_uzip_taste(). After retrieve all the block offsets fromloos2014-05-011-0/+1
| | | | the uzip image, free the last data read.
* Actually the FEATURE() macro is defined on sys/sysctl.h.loos2014-05-011-0/+1
| | | | Pointyhat to: loos
OpenPOWER on IntegriCloud