summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MFC r302497:kp2016-08-171-4/+12
| | | | | | | | | | | | pf: Map hook returns onto the correct error values pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers expect to get E<foo> error codes. Map the returns values. A pass is 0 (everything is OK), anything else means pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP error message. PR: 207598
* MFC r303663:kp2016-08-171-3/+3
| | | | | | | | | pfctl: Allow TOS bits to be cleared TOS value 0 is valid, so use 256 as an invalid value rather than zero. This allows users to enforce TOS == 0 with pf. Reported by: Radek KrejĨa <radek.krejca@starnet.cz>
* MFC r303916:kib2016-08-171-4/+7
| | | | Convert another tmpfs assert into runtime check.
* MFC r303914:kib2016-08-171-4/+7
| | | | Re-schedule signals after kthread exits.
* MFC r303913:kib2016-08-172-4/+4
| | | | | Unconditionally perform checks that FPU region was entered, when #NM exception is caught in kernel mode.
* MFstable/11 r304208:ngie2016-08-162-3/+3
| | | | | | | | | | MFC r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*]
* MFC r302943,r302944,r303004,r303010,r303011,r303013,r303014,r303074,ache2016-08-162-213/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r303088,r303142,r303208,r303210,r303530,r303536,r303564,r303565, r303706 In short: 1) All situations with glob(3) error return codes are well defined by POSIX, so rewrite old sporadic errors processing to match those definitions. Including subcases: Both C99 and POSIX directly prohibits any standard function to set errno to 0. Breaking this rule in 2001 NetBSD hack was imported which attempts to workaround very limited glob(3) return codes amount. Use POSIX-compatible workaround now with E2BIG which can't comes from other functions used instead of prohibited 0. Process errors happpens in (*readdirfunc)() too, as POSIX requires. Per POSIX GLOB_NOCHECK should return original pattern, unmodified, if no matches found. But our code strips all '\' returning it. Rewrite the code to allow to return original pattern. GLOB_ERR and gl_errfunc are supposed to work only for real directories per POSIX, so don't act on missing or plain files for ENOENT or ENOTDIR (as TODO in the code suggested). Remove the hack in the manpage describing how to skip ENOENT and ENOTDIR in gl_errfunc, it is unneeded now. Per POSIX GLOB_ERR must be considered even if gl_errfunc is not set, old code skips it in that case. 2) For near MAXPATHLEN long pathes old glob(3) code can operate on truncated results, prevent it in several places. 3) Results was not sorted according to collate as POSIX requires. 4) globtilde() forget to convert expanded user home dir from multibyte to wide chars. Moreover, those chars are addded as not protected, so can be treated as special chars. 5) Backward hack for EILSEQ in g_Ctoc() was not implemented, so all pathes with illegal byte sequences are skipped as result, implement it now. 6) GLOB_BRACE was somehow broken. First it repeatedly calls glob0() in globexp1() recursive calls, but glob0() was not supposed to be called repeatedly in the original code. It finalize results by possible adding original pattern for no match case, may return GLOB_NOMATCH error and by sorting all things. Original pattern adding or GLOB_NOMATCH error can happens each time glob0() called repeatedly, and sorting happens for one item only, all things are never sorted. Second, f.e. "a{a" pattern does not match "a{a" file but match "a" file instead. Third, some errors (f.e. for limits or overflow) can be ignored by GLOB_BRACE code because it forces return (0). Add non-finalizing flag to glob0() and make globexp0() wrapper around recursively called globexp1() to finalize things like glob0() does. Reorganize braces code to work correctly. 7) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING (ARG_MAX) limit, use final string length, not malloced space for it.
* MFC r303423:kib2016-08-156-22/+73
| | | | Force SIGSTOP to be the first signal reported after the attach.
* MFC 302900,302902,302921,303461,304009:jhb2016-08-1513-82/+471
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC r303934,r303937,r303942:bdrewery2016-08-151-0/+2
| | | | | | | | | r303934: Support rmdir(2). r303937: Use proper argument length for rmdir(2) for r303934. r303942: Fix sorting in r303934.
* MFC r303964:bdrewery2016-08-152-2/+3
| | | | PROGS: Support INTERNALPROG.prog=yes to not install it.
* MFC r302838: 6513 partially filled holes lose birth timeavg2016-08-158-53/+188
|
* MFC r302837: 6844 dnode_next_offset can detect fictional holesavg2016-08-152-5/+23
|
* MFC r302836: 6874 rollback and receive need to reset ZPL state to what's on diskavg2016-08-151-108/+103
|
* MFC r303870:hselasky2016-08-151-0/+7
| | | | | | | | | | | | Fix for use after free. Clear the device description to avoid use after free because the bsddev is not destroyed when the mlx5en module is unloaded. Only when the parent mlx5 module is unloaded the bsddev is destroyed. This fixes a panic on listing sysctls which refer strings in the bsddev after the mlx5en module has been unloaded. Sponsored by: Mellanox Technologies
* MFC r302835: fix-up for configuration of AMD Family 10h processorsavg2016-08-151-0/+14
| | | | borrowed from Linux
* MFC r302840: 6878 Add scrub completion info to "zpool history"avg2016-08-151-5/+19
|
* MFC r303765:hselasky2016-08-151-1/+11
| | | | | | | | Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Found by: Bruce Evans <brde@optusnet.com.au>
* MFC r302839: 6940 Cannot unlink directories when over quotaavg2016-08-151-0/+1
|
* MFC r303086: 7164 zdb should be able to open the root datasetavg2016-08-152-1/+28
|
* MFC r303084: 6391 Override default SPA config location via environmentavg2016-08-151-0/+10
|
* MFC r303059markj2016-08-141-3/+2
| | | | Release the second critical section in uma_zfree_arg() slightly earlier.
* MFC r303516markj2016-08-141-1/+1
| | | | Use vm_page_undirty() instead of manually setting a page field.
* MFC r303244, r303399markj2016-08-141-19/+19
| | | | De-pluralize "queues" in the pagedaemon code.
* MFC r303971:smh2016-08-142-24/+38
| | | | | | Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS Sponsored by: Multiplay
* MFC r303806:cy2016-08-131-0/+1
| | | | Add Logitech Unifying receiver.
* Document EN-16:10 through EN-16:16.gjb2016-08-121-0/+56
| | | | Sponsored by: The FreeBSD Foundation
* MFC 292894,292896: Add ptrace(2) reporting for LWP events.jhb2016-08-128-30/+301
| | | | | | | | | | | | | | 292894: Add ptrace(2) reporting for LWP events. Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting thread creation and destruction. Newly created threads will stop to report PL_FLAG_BORN before returning to userland and exiting threads will stop to report PL_FLAG_EXIT before exiting completely. Both of these events are only enabled and reported if PT_LWP_EVENTS is enabled on a process. 292896: Document the recently added support for ptrace(2) LWP events.
* MFC r303897:gjb2016-08-121-1/+7
| | | | | | | | Pass overrides to make(1) when building ports for arm/armv6 targets, similar to what is done for the run-autotools-fixup override for non-arm targets. Sponsored by: The FreeBSD Foundation
* MFC r302371:hselasky2016-08-121-1/+1
| | | | | Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure "struct xhci_dev_ctx_addr" fits into a single 4K page until further.
* MFC r301039:hselasky2016-08-121-3/+19
| | | | | | | | Add support for simplex USB MIDI devices, which only provide BULK or INTERRUPT endpoints for moving data in one direction, like the KeyRig 49 from M-Audio. Requested by: Ivan Klymenko <fidaj@ukr.net>
* MFC r303773alc2016-08-101-1/+1
| | | | Correct a spelling error.
* MFC 273102:jhb2016-08-101-1/+1
| | | | | | | | | | Use '-e' to check if the virtio backing file has already been created. The '-f' check works fine on a regular file but not if the backing file is a device (e.g., /dev/md0). In this case it would print a misleading but otherwise benign message about the backing file not being present. PR: 210410
* MFC r303782:gjb2016-08-101-3/+3
| | | | | | | Fix GCE image publication. The gcutil utility is deprecated in favor of gcloud. Sponsored by: The FreeBSD Foundation
* MFC r303710:kib2016-08-104-40/+18
| | | | | | | Remove unneeded (recursing) Giant acquisition around vprintf(9). MFC r303715: Remove ncl_printf(), use printf(9) directly.
* MFC r303704:kib2016-08-104-16/+8
| | | | | | | Some style changes. Fix a typo in comment. MFC r303705: Remove Giant asserts. Update comment.
* MFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.jhb2016-08-091-1/+1
| | | | | If a thread is created bound to a cpuset it might already be bound before its very first timeslice, and td_lastcpu will be NOCPU in that case.
* MFC r270132 (by gabor):dim2016-08-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not look for more matching lines if -L is specified Submitted by: eadler (based on) MFC r296799 (by ian): Fix a bug in bsdgrep that caused the program to hang in a tight loop for some combinations of command line options and search patterns. The code was examining regexec flags looking for a regcomp flag value. The fix is to look in the struct field where the decoded regcomp flag was stored when the regex was compiled. With this fix, it's possible to build WITHOUT_GNU_GREP_COMPAT and WITH_BSDGREP and have a usable GPL-free grep (which of course lacks gnugrep extensions). It now passes the kyua tests except for one test that requires the -z/--null-data gnu extension, and one test involving outputting context lines across multiple files which appears to sometimes output an extra delimiter line ("--") between matches (a rather obscure failure of a rather obscure feature, so bsdgrep should be generally usable now). MFC r303676: Fix a segfault in bsdgrep when parsing the invalid extended regexps "?" or "+" (these are invalid, because there is no preceding operand). When bsdgrep attempts to emulate GNU grep in discarding and ignoring the invalid ? or + operators, some later logic in tre_compile_fast() goes beyond the end of the buffer, leading to a crash. Fix this by bailing out, and reporting a bad pattern instead. Reported by: Steve Kargl
* MFC r303760:loos2016-08-091-0/+10
| | | | | | | | | | Fix a regression in pf.conf while parsing the 'interval' keyword. The bug was introduced by r287009. PR: 210924 Submitted by: kp@ Sponsored by: Rubicon Communications (Netgate)
* Document missing ENs and SAs.gjb2016-08-082-2/+103
| | | | | Reviewed by: brd Sponsored by: The FreeBSD Foundation
* Increase the IMX (CUBOX-HUMMINGBOARD, WANDBOARD) image size togjb2016-08-083-2/+4
| | | | | | | | | | | | successfully build. While here, add the SRCBRANCH to the CUBOX-HUMMINGBOARD.conf and GUMSTIX.conf. This is a direct commit to stable/10, as the images for stable/11 are already larger than this. Sponsored by: The FreeBSD Foundation
* MFC r290521:kp2016-08-081-2/+2
| | | | | | | | | | pf: Fix broken rule skip calculation r289932 accidentally broke the rule skip calculation. The address family argument to PF_ANEQ() is now important, and because it was set to 0 the macro always evaluated to false. This resulted in incorrect skip values, which in turn broke the rule evaluations.
* MFC r280331:bdrewery2016-08-084-4/+17
| | | | | | cred: add proc_set_cred_init helper PR: D7431
* MFC r280330,r282567:bdrewery2016-08-081-8/+8
| | | | | | | | | r280330: fork: assign refed credentials earlier r282567: Fix up panics when fork fails due to hitting proc limit PR: D7431
* MFC 303737sephe2016-08-081-2/+21
| | | | | | | | | | | | hyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP support The Hyper-V on pre-win10 systems will only report SPC-2 conformance, but it actually conforms to SPC-3. The INQUIRY response is adjusted to propagate the SPC-3 version information to CAM. Submitted by: Hongjiang Zhang <honzhan microsoft com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7405
* MFC 303076,303225: Use MTX_SYSINIT for the VESA lock.jhb2016-08-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 303076: vesa: fix panic on suspend Fix the following panic seen when migrating a FreeBSD guest on Xen: panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541 cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe001d2fa4f0 vpanic() at vpanic+0x182/frame 0xfffffe001d2fa570 kassert_panic() at kassert_panic+0x126/frame 0xfffffe001d2fa5e0 __mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfffffe001d2fa630 vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 0xfffffe001d2fa680 vga_suspend() at vga_suspend+0xa3/frame 0xfffffe001d2fa6b0 isavga_suspend() at isavga_suspend+0x1d/frame 0xfffffe001d2fa6d0 bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame [...] This is caused because vga_sub_configure (which is called if the VGA adapter is attached after VESA tried to initialize), points to vesa_configure, which doesn't initialize the VESA mutex. In order to fix it, make sure vga_sub_configure points to vesa_load, so that all the needed vesa components are properly initialized. 303225: Use MTX_SYSINIT for the VESA lock. vesa_init_done isn't a reliable guard for the mutex init. If vesa_configure() doesn't find valid VESA info it will not set vesa_init_done, but the lock will remain initialized. Revert r303076 and use MTX_SYSINIT to deterministically init the lock. PR: 209203
* MFC r303702:kib2016-08-061-3/+3
| | | | Remove mention of Giant from the fork_return() description.
* MFC 302181,302635: Disable MSI-X migration on older Xen hypervisors.jhb2016-08-054-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | 302181: Add a tunable to disable migration of MSI-X interrupts. The new 'machdep.disable_msix_migration' tunable can be set to 1 to disable migration of MSI-X interrupts. Xen versions prior to 4.6.0 do not properly handle updates to MSI-X table entries after the initial write. In particular, the operation to unmask a table entry after updating it during migration is not propagated to the "real" table for passthrough devices causing the interrupt to remain masked. At least some systems in EC2 are affected by this bug when using SRIOV. The tunable can be set in loader.conf as a workaround. 302635: xen: automatically disable MSI-X interrupt migration If the hypervisor version is smaller than 4.6.0. Xen commits 74fd00 and 70a3cb are required on the hypervisor side for this to be fixed, and those are only included in 4.6.0, so stay on the safe side and disable MSI-X interrupt migration on anything older than 4.6.0. It should not cause major performance degradation unless a lot of MSI-X interrupts are allocated.
* MFC r303393:kib2016-08-033-7/+0
| | | | Remove empty initializer for the once facility.
* MFC r302330:ngie2016-08-031-0/+14
| | | | Remove ftp(1) related files when MK_FTP == no
OpenPOWER on IntegriCloud