summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* - Implement two new system calls:pjd2013-03-0222-54/+475
| | | | | | | | | | | | | | | | | | | | | | | | | int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen); int connectat(int fd, int s, const struct sockaddr *name, socklen_t namelen); which allow to bind and connect respectively to a UNIX domain socket with a path relative to the directory associated with the given file descriptor 'fd'. - Add manual pages for the new syscalls. - Make the new syscalls available for processes in capability mode sandbox. - Add capability rights CAP_BINDAT and CAP_CONNECTAT that has to be present on the directory descriptor for the syscalls to work. - Update audit(4) to support those two new syscalls and to handle path in sockaddr_un structure relative to the given directory descriptor. - Update procstat(1) to recognize the new capability rights. - Document the new capability rights in cap_rights_limit(2). Sponsored by: The FreeBSD Foundation Discussed with: rwatson, jilles, kib, des
* Fix ipfw table argument parsing/printing.melifaro2013-03-021-54/+92
| | | | | | | | Fix style. PR: kern/175909 Submitted by: Daniel Hagerty <hag@linnaean.org> MFC after: 2 weeks
* Garbage collect NTFS bits which are now completely disconnected fromattilio2013-03-0220-5023/+10
| | | | | | the tree since few months. This patch is not targeted for MFC.
* Remove ntfs headers dependency for g_label_ntfs.c by redefining theattilio2013-03-021-14/+65
| | | | | | used structs and values. This patch is not targeted for MFC.
* Comment cosmetics: capitalize SCSIschweikh2013-03-021-8/+8
| | | | | | Fix some hard tabs in the wrong place. MFC after: 2 weeks
* The value held by the vm object's field pg_color is only consideredalc2013-03-021-1/+0
| | | | | | | valid if the flag OBJ_COLORED is set. Since _vm_object_allocate() doesn't set this flag, it needn't initialize pg_color. Sponsored by: EMC / Isilon Storage Division
* Garbage collect PORTALFS bits which are now completely disconnected fromattilio2013-03-0222-3005/+7
| | | | | | the tree since few months. This patch is not targeted for MFC.
* Garbage collect CODAFS bits which are now completely disconnected fromattilio2013-03-0222-6161/+2
| | | | | | the tree since few months. This patch is not targeted for MFC.
* - Complete r231621 by also blacklisting the bridge used by VMware for PCIemarius2013-03-021-10/+11
| | | | | | | | | | devices. While at it, update the comment now that we know that MSI-X doesn't work with ESXi 5.1 for Intel 82576 either and the underlying issue is a bug in the MSI-X allocation code of the hypervisor. Reported by: Harald Schmalzbauer - Make the nomatch table const. MFC after: 1 week
* Garbage collect XFS bits which are now already completely disconnectedattilio2013-03-02167-108267/+2
| | | | | | from the tree since few months. This is not targeted for MFC.
* Garbage collect HPFS bits which are now already completely disconnectedattilio2013-03-0213-4724/+0
| | | | | | | | from the tree since few months (please note that the userland bits were already disconnected since a long time, thus there is no need to update the OLD* entries). This is not targeted for MFC.
* Fix callout expiring dynamic rules.melifaro2013-03-021-3/+3
| | | | | | PR: kern/175530 Submitted by: Vladimir Spiridenkov <vs@gtn.ru> MFC after: 2 weeks
* Merge from vmc-playground branch:attilio2013-03-024-57/+57
| | | | | | | | | | | Rename the pv_entry_t iterator from pv_list to pv_next. Besides being more correct technically (as the name seems to suggest this is a list while it is an iterator), it will also be needed by vm_radix work to avoid a nameclash on macro expansions. Sponsored by: EMC / Isilon storage division Reviewed by: alc, jeff Tested by: flo, pho, jhb, davide
* - Revert the part of r247601 which turned the overtemperature and power failmarius2013-03-021-11/+9
| | | | | | | | | interrupt shutdown handlers into filters. Shutdown_nice(9) acquires a sleep lock, which filters shouldn't do. It also seems that kern_reboot(9) still may require Giant to be hold. - Correct an incorrect argument to shutdown_nice(9). Submitted by: bde
* Revert the part of r247600 which turned the overtemperature and power failmarius2013-03-021-18/+16
| | | | | | | | interrupt shutdown handlers into filters. Shutdown_nice(9) acquires a sleep lock, which filters shouldn't do. It also seems that kern_reboot(9) still may require Giant to be hold. Submitted by: bde
* nullfs: Improve f_flags in statfs().jilles2013-03-021-1/+2
| | | | | | | | | | | | | | | | Include some flags of the nullfs mount itself: MNT_RDONLY, MNT_NOEXEC, MNT_NOSUID, MNT_UNION, MNT_NOSYMFOLLOW. This allows userland code calling statfs() or fstatfs() to see these flags. In particular, this allows opendir() to detect that a -t nullfs -o union mount needs deduplication (otherwise at least . and .. are returned twice) and allows rtld to detect a -t nullfs -o noexec mount as noexec. Turn off the MNT_ROOTFS flag from the underlying filesystem because the nullfs mount is definitely not the root filesystem. Reviewed by: kib MFC after: 1 week
* If the target file already exists, check for the CAP_UNLINKAT capabiity rightpjd2013-03-021-7/+10
| | | | | | | | | | on the target directory descriptor, but only if this is renameat(2) and real target directory descriptor is given (not AT_FDCWD). Without this fix regular rename(2) fails if the target file already exists. Reported by: Michael Butler <imb@protected-networks.net> Reported by: Larry Rosenman <ler@lerctr.org> Sponsored by: The FreeBSD Foundation
* Disable the ctl driver in GENERIC.adrian2013-03-023-2/+9
| | | | | | It unfortunately steals a fair chunk of RAM at startup even if it's not actively used, which prevents FreeBSD VMs of 128MB from successfully booting and running.
* mdoc: remove superfluous paragraph macro.joel2013-03-023-3/+0
|
* Make this WARNS=9 clean on i386 w/ clang.marcel2013-03-021-15/+14
|
* Fix warnings (control reaches end of non-void function).marcel2013-03-021-1/+2
|
* Fix nandfs support by providing the same crc32 function as is usedmarcel2013-03-021-2/+23
| | | | | | in newfs_nandfs. In libstand we get crc32 from libz. The polynomial is not the same as used for nandfs, which is the crc32 used in the kernel.
* Move some virtual memory constants to the top of the file where they are onandrew2013-03-021-21/+25
| | | | | | | | | | | other architectures [1]. While here: - Remove an unused and commented out include. - Add a comment describing the file that other copies have. - Fix the style of the defines and add a comment on what each one is. Suggested by: [1] alc
* Build the Raspberry Pi dtb file when building the kernel so we can copy itandrew2013-03-021-1/+1
| | | | to the boot partition for U-Boot.
* Ensure the stack is correctly aligned before calling the first C function.andrew2013-03-021-0/+1
|
* Add regression tests for the new Capsicum system calls.pjd2013-03-026-0/+1387
| | | | Sponsored by: The FreeBSD Foundation
* Update existing regression tests after Capsicum overhaul.pjd2013-03-022-101/+349
|
* Regen after r247602.pjd2013-03-0211-31/+374
|
* Merge Capsicum overhaul:pjd2013-03-0261-1124/+1840
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Capability is no longer separate descriptor type. Now every descriptor has set of its own capability rights. - The cap_new(2) system call is left, but it is no longer documented and should not be used in new code. - The new syscall cap_rights_limit(2) should be used instead of cap_new(2), which limits capability rights of the given descriptor without creating a new one. - The cap_getrights(2) syscall is renamed to cap_rights_get(2). - If CAP_IOCTL capability right is present we can further reduce allowed ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed ioctls can be retrived with cap_ioctls_get(2) syscall. - If CAP_FCNTL capability right is present we can further reduce fcntls that can be used with the new cap_fcntls_limit(2) syscall and retrive them with cap_fcntls_get(2). - To support ioctl and fcntl white-listing the filedesc structure was heavly modified. - The audit subsystem, kdump and procstat tools were updated to recognize new syscalls. - Capability rights were revised and eventhough I tried hard to provide backward API and ABI compatibility there are some incompatible changes that are described in detail below: CAP_CREATE old behaviour: - Allow for openat(2)+O_CREAT. - Allow for linkat(2). - Allow for symlinkat(2). CAP_CREATE new behaviour: - Allow for openat(2)+O_CREAT. Added CAP_LINKAT: - Allow for linkat(2). ABI: Reuses CAP_RMDIR bit. - Allow to be target for renameat(2). Added CAP_SYMLINKAT: - Allow for symlinkat(2). Removed CAP_DELETE. Old behaviour: - Allow for unlinkat(2) when removing non-directory object. - Allow to be source for renameat(2). Removed CAP_RMDIR. Old behaviour: - Allow for unlinkat(2) when removing directory. Added CAP_RENAMEAT: - Required for source directory for the renameat(2) syscall. Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR): - Allow for unlinkat(2) on any object. - Required if target of renameat(2) exists and will be removed by this call. Removed CAP_MAPEXEC. CAP_MMAP old behaviour: - Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and PROT_WRITE. CAP_MMAP new behaviour: - Allow for mmap(2)+PROT_NONE. Added CAP_MMAP_R: - Allow for mmap(PROT_READ). Added CAP_MMAP_W: - Allow for mmap(PROT_WRITE). Added CAP_MMAP_X: - Allow for mmap(PROT_EXEC). Added CAP_MMAP_RW: - Allow for mmap(PROT_READ | PROT_WRITE). Added CAP_MMAP_RX: - Allow for mmap(PROT_READ | PROT_EXEC). Added CAP_MMAP_WX: - Allow for mmap(PROT_WRITE | PROT_EXEC). Added CAP_MMAP_RWX: - Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC). Renamed CAP_MKDIR to CAP_MKDIRAT. Renamed CAP_MKFIFO to CAP_MKFIFOAT. Renamed CAP_MKNODE to CAP_MKNODEAT. CAP_READ old behaviour: - Allow pread(2). - Disallow read(2), readv(2) (if there is no CAP_SEEK). CAP_READ new behaviour: - Allow read(2), readv(2). - Disallow pread(2) (CAP_SEEK was also required). CAP_WRITE old behaviour: - Allow pwrite(2). - Disallow write(2), writev(2) (if there is no CAP_SEEK). CAP_WRITE new behaviour: - Allow write(2), writev(2). - Disallow pwrite(2) (CAP_SEEK was also required). Added convinient defines: #define CAP_PREAD (CAP_SEEK | CAP_READ) #define CAP_PWRITE (CAP_SEEK | CAP_WRITE) #define CAP_MMAP_R (CAP_MMAP | CAP_SEEK | CAP_READ) #define CAP_MMAP_W (CAP_MMAP | CAP_SEEK | CAP_WRITE) #define CAP_MMAP_X (CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL) #define CAP_MMAP_RW (CAP_MMAP_R | CAP_MMAP_W) #define CAP_MMAP_RX (CAP_MMAP_R | CAP_MMAP_X) #define CAP_MMAP_WX (CAP_MMAP_W | CAP_MMAP_X) #define CAP_MMAP_RWX (CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X) #define CAP_RECV CAP_READ #define CAP_SEND CAP_WRITE #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) #define CAP_SOCK_SERVER \ (CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \ CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ CAP_SETSOCKOPT | CAP_SHUTDOWN) Added defines for backward API compatibility: #define CAP_MAPEXEC CAP_MMAP_X #define CAP_DELETE CAP_UNLINKAT #define CAP_MKDIR CAP_MKDIRAT #define CAP_RMDIR CAP_UNLINKAT #define CAP_MKFIFO CAP_MKFIFOAT #define CAP_MKNOD CAP_MKNODAT #define CAP_SOCK_ALL (CAP_SOCK_CLIENT | CAP_SOCK_SERVER) Sponsored by: The FreeBSD Foundation Reviewed by: Christoph Mallon <christoph.mallon@gmx.de> Many aspects discussed with: rwatson, benl, jonathan ABI compatibility discussed with: kib
* - Apparently, it's no longer a problem to call shutdown_nice(9) from withinmarius2013-03-021-12/+14
| | | | | | | | | | an interrupt filter (some other drivers in the tree do the same). So change the overtemperature and power fail interrupts from handlers in order to code and get rid of a !INTR_MPSAFE handlers. - Mark unused parameters as such. - Use NULL instead of 0 for pointers. MFC after: 1 week
* - While Netra X1 generally show no ill effects when registering a powermarius2013-03-022-28/+44
| | | | | | | | | | | | | | | | | fail interrupt handler, there seems to be either a broken batch of them or a tendency to develop a defect which causes this interrupt to fire inadvertedly. Given that apart from this problem these machines work just fine, add a tunable allowing the setup of the power fail interrupt to be disabled. While at it, remove the DEBUGGER_ON_POWERFAIL compile time option and make that behavior also selectable via the newly added tunable. - Apparently, it's no longer a problem to call shutdown_nice(9) from within an interrupt filter (some other drivers in the tree do the same). So change the power fail interrupt from an handler in order to simplify the code and get rid of a !INTR_MPSAFE handler. - Use NULL instead of 0 for pointers. MFC after: 1 week
* Provide cap_sandboxed(3) function, which is a wrapper around cap_getmode(2)pjd2013-03-025-0/+124
| | | | | | | | | | | system call, which has a nice property - it never fails, so it is a bit easier to use. If there is no support for capability mode in the kernel the function will return false (not in a sandbox). If the kernel is compiled with the support for capability mode, the function will return true or false depending if the calling process is in the capability mode sandbox or not respectively. Sponsored by: The FreeBSD Foundation
* Fix assignment of maximum bounadary.delphij2013-03-011-1/+1
| | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev fd39c81ba220f7ad6e4dc9b30d45e828cf58a1ad MFC after: 2 weeks
* Fix wrong assignment.delphij2013-03-011-1/+1
| | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev 9568dd07a22a136e380e6c19a8ea188eb92976d5 MFC after: 2 weeks
* Fix a typo in mfi_stp_cmd() that would give wrong assignment.delphij2013-03-011-1/+1
| | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev 0dc98fff2206d7bb78ce5e07ac34d6954e4bd96a MFC after: 3 days
* MFV r247575:delphij2013-03-011-2/+2
| | | | | | | | | | Import a fix tighten assertion on SPA versions from vendor (Illumos). Illumos ZFS issue: 3543 Feature flags causes assertion in spa.c to miss certain cases MFC after: 2 weeks
* Initialize count in order to appease clang.marius2013-03-011-0/+1
| | | | Submitted by: delphij
* Initialize count in order to appease clang.marius2013-03-011-0/+1
| | | | Submitted by: delphij
* Replace the TDP_NOSLEEPING flag with a counter so that thejhb2013-03-015-19/+12
| | | | | | THREAD_NO_SLEEPING() and THREAD_SLEEPING_OK() macros can nest. Reviewed by: attilio
* Increase the maximum text size on ARM to 64MiB. Without this clang would beandrew2013-03-011-1/+3
| | | | | | | | | | sent a SIGABRT when it is loaded as it is too large. This is the smallest power of two MiB value that allows us to execute clang. While here wrap it in an #ifndef to be consistent with the other architectures. Submitted by: Daisuke Aoyama <aoyama at peach.ne.jp>
* Remove unnecessary variables.pjd2013-03-011-6/+2
|
* MFV r247316:mm2013-03-015-1/+44
| | | | | | | | | | | | | Merge new read-only zfs properties from vendor (illumos) Illumos ZFS issues: 3588 provide zfs properties for logical (uncompressed) space used and referenced References: https://www.illumos.org/issues/3588 MFC after: 2 weeks
* Reduce lock scope a little.pjd2013-03-011-1/+1
|
* - Move reporting of failures to disable RX/TX MAC under bootverbose as atmarius2013-03-011-4/+10
| | | | | | | | | | | | least the Saturn chips of 501-6738 cards may fail to do so the first time, which isn't fatal though. Reported by: Paul Keusemann - Explain why we don't enable infinite bursts on sparc64. - Given that these chips support memory write invalidate, make sure that it's enabled in the command register. Also make sure that PERR# and SERR# assertion is enabled. MFC after: 1 week
* - In sbbc_pci_attach() just pass the already obtained bus tag and handlemarius2013-03-011-4/+3
| | | | | | | instead of acquiring these anew. - Use NULL instead of 0 for pointers. MFC after: 1 week
* - Remove an unused header.marius2013-03-011-6/+41
| | | | | | | | | | | - Use NULL instead of 0 for pointers. - Let ofw_pcib_probe() return BUS_PROBE_DEFAULT instead of 0 so specialized PCI-PCI-bridge drivers may attach instead. - Add WARs for PLX Technology PEX 8114 bridges and PEX 8532 switches. Ideally, these should live in MI code but at least for the latter we're missing the necessary infrastructure there. MFC after: 1 week
* - Apparently, r186520 was just wrong and the clock of Oxford OX16PCI958 ismarius2013-03-011-7/+8
| | | | | | | | | | | | | | | | | | | neither DEFAULT_RCLK * 2 nor DEFAULT_RCLK * 10 but plain DEFAULT_RCLK and there's no (open) source indicating otherwise. This was tested with an EXSYS EX-41098-2, whose clock is not configurable and identifies as: puc0@pci0:5:1:0: class=0x070200 card=0x06711415 chip=0x95381415 rev=0x01 hdr=0x00 vendor = 'Oxford Semiconductor Ltd' class = simple comms subclass = multiport serial Note that this exactly matches the card mentioned in PR 129665 so no sub-device/sub-vendor based quirking of the latter is possible. So maybe we should grow some sort of tunable, in case non-default cards such as the latter aren't configurable either (this also wouldn't be the first time an allegedly tested commit turns out to be wrong though). - Make the TiMedia tables const. MFC after: 1 week
* - Make tables, device ID strings etc const. This includes #ifdef'ing 0marius2013-03-016-112/+110
| | | | | | | | | | | | | | | | | | | aac_command_status_table, which is actually unused since r111532. While at it, make aac_if a pointer to the now const interface tables instead of copying them over to the softc (this alone already reduces the size of aac.ko on amd64 by ~1 KiB). - Remove redundant softc members. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Use pci_enable_busmaster(9) instead of duplicating it. - Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will just fail). - Canonicalize the error messages in case of resource allocation failures. - Add support for using MSI instead of INTx, controllable via the tunable hw.aac.enable_msi (defaulting to on). MFC after: 1 month
* - Make tables, device ID strings etc const.marius2013-03-012-59/+34
| | | | | | | | | | | | - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Remove redundant/unused softc members. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Re-use bus accessor macros instead of duplicating them. - In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY address (missed in r213893). MFC after: 1 week
* Eliminate a redundant #include: machine/pmap.h is already includedalc2013-03-017-7/+0
| | | | through vm/pmap.h.
OpenPOWER on IntegriCloud