summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Only build the libmagic build-tools if MK_FILE != noAlex Richardson2017-11-131-1/+4
| | | | | | | | | | | | Before this patch libmagic was always built in the build-tools phase even if -DWITHOUT_FILE was specified. Reviewed by: emaste, jhb Approved by: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D12925 Notes: svn path=/head/; revision=325772
* Only clear a pending thread event if one is pending.John Baldwin2017-11-131-26/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a panic when attaching to an already-stopped process after r325028. While here, clean up a few other things in the control flow of the 'sendsig' section: - Only check for P_STOPPED_TRACE rather than either of P_STOPPED_SIG or P_STOPPED_TRACE for most ptrace requests. The signal handling code in kern_sig.c never sets just P_STOPPED_SIG for a traced process, so if P_STOPPED_SIG is stopped, P_STOPPED_TRACE should be set anyway. Remove a related debug printf. Assuming P_STOPPED_TRACE permits simplifications in the 'sendsig:' block. - Move the block to clear the pending thread state up into a new block conditional on P_STOPPED_TRACE and handle delivering pending signals to the reporting thread and clearing the reporting thread's state in this block. - Consolidate case to send a signal to the process in a single case for PT_ATTACH. The only case that could have been in the else before was a PT_ATTACH where P_STOPPED_SIG was not set, so both instances of kern_psignal() collapse down to just PT_ATTACH. Reported by: pho, mmel Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D12837 Notes: svn path=/head/; revision=325771
* Remove -fuse-ld= when creating _LDFLAGS from LDFLAGSAlex Richardson2017-11-131-1/+1
| | | | | | | | | | | | The -fuse-ld flag is only meant to be passed to the compiler driver so direct linker invocations should not include it. Reviewed by: emaste, jhb Approved by: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D12910 Notes: svn path=/head/; revision=325770
* Update the GUMSTIX image build to use arm/arm TARGET/TARGET_ARCH.Glen Barber2017-11-133-3/+3
| | | | | | | | | | | | Update the TARGET/TARGET_ARCH matching in release/release.sh and release/Makefile.mirrors for simplification. Discussed with: mmel MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=325769
* arm: rpi2: Fix cpufreq(4)Emmanuel Vadot2017-11-131-0/+1
| | | | | | | | | | | | Since r324184 the root node compatible for rpi2 is "brcm,bcm2836", add it to the compatible list of bcm2835_cpufreq. Tested On: RPI2 v1.1 RPI2 v1.2 Reported by: many on freebsd-arm@ Notes: svn path=/head/; revision=325768
* Properly handle the case where the linux_cdev_handle_insert() functionHans Petter Selasky2017-11-131-22/+44
| | | | | | | | | | | | | in the LinuxKPI returns NULL. This happens when the VM area's private data handle already exists and could cause a so-called NULL pointer dereferencing issue prior to this fix. Found by: greg@unrelenting.technology MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=325767
* Fix formatting of _umtx_op(2)Eric van Gyzen2017-11-131-60/+70
| | | | | | | | | | | | | | Do not use macros in the -width of a .Bl, since mandoc does not support them. Fix issues reported by igor and mandoc -Tlint. Use a .Bl for list of clock IDs instead of a comma list. MFC after: 3 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=325766
* Add notes about overlapping copies.Warner Losh2017-11-133-0/+25
| | | | | | | | | | | | | | Add notes to each of these that specifically state that results are undefined if the strings overlap. In the case of memcpy, we document the overlapping behavior on FreeBSD (pre-existing). For str*, it is left unspecified, however, since the default (and x86) implementations do not handle overlapping strings properly. PR: 223653 Sponsored by: Netflix Notes: svn path=/head/; revision=325765
* Add __BEGIN_DECLS and __END_DECLS to <sys/umtx.h>Eric van Gyzen2017-11-131-0/+4
| | | | | | | | | | This allows C++ programs to call _umtx_op(). MFC after: 3 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=325764
* Do not leak PMC_PO_OWNS_LOGFILE on error.Konstantin Belousov2017-11-131-0/+1
| | | | | | | | | | | | Note that PMCLOG_RESERVE_WITH_ERROR() macro contains goto error; statement and executed after the flag is set. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=325759
* Style bug.Konstantin Belousov2017-11-131-1/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=325758
* Be more careful when doing calculation with request from userland.Xin LI2017-11-131-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=325755
* Document MACHINE, MACHINE_ARCH, CPUTYPE, TARGET and TARGET_ARCHWarner Losh2017-11-131-0/+84
| | | | | | | | | | historical use and general philosphy. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D12981 Notes: svn path=/head/; revision=325749
* Use proper include file. While <boot/userboot/userboot.h> works, itWarner Losh2017-11-131-1/+1
| | | | | | | | | | | | only works because we have -Isys on the command line. We also have -Isys/boot/userboot on the command line, so bring it in directly with <userboot.h>. No functional change, but it removes one hard to see dependency on the boot loader's location in sys/boot. Sponsored by: Netflix Notes: svn path=/head/; revision=325748
* Add Intel Processor Trace (PT) MSRs.Ruslan Bukin2017-11-121-0/+56
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=325747
* Cleanup the handling of control chunks. While there fix some minorMichael Tuexen2017-11-121-240/+110
| | | | | | | | | | bug related to clearing the assoc retransmit counter and the dup TSN handling of NR-SACK chunks. MFC after: 3 days Notes: svn path=/head/; revision=325746
* boot1: also check for NULL deviceEd Maste2017-11-121-7/+9
| | | | | | | | | | | | | | | | | r325681 fixed a NULL pointer dereference on RPi3 caused by a lack of functionality in uboot's EFI implementation. That rev checked the boot1 load path for NULL but not the load device. In practice if the former works the latter will as well, but improve correctness by checking each separately. Submitted by: Keith White <kwhite@eecs.uottawa.ca> Reported by: jhb MFC after: 5 days MFC with: r325681 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=325744
* Make sure the proper loader.rc gets installed.Warner Losh2017-11-121-3/+10
| | | | | | | | | | | | | | There were two things wrong. First, the wrong path was listed in .PATH statement. Second, BOOTSRC wasn't yet defined for the .PATH, so it didn't properly add it. Third, even if these were right, . was in the path before, so it wouldn't have worked. Replace this with a simple loop so the proper loader.rc gets selected. Noticed by: dhw@ (menus stopped working on boot) Sponsored by: Netflix Notes: svn path=/head/; revision=325743
* Stop installing eqnchar which has been removedBaptiste Daroussin2017-11-121-1/+1
| | | | | | | Pointyhat to: bapt Notes: svn path=/head/; revision=325742
* dhclient(8) should not close stdio using daemon(3) function.Mariusz Zaborski2017-11-121-1/+1
| | | | | | | | | | | | | | | dhclient(8) is chrooted so opening /dev/null always will fail. In capability world this is also annoying because we getting error that open(2) is not permitted in Capsicum. dhclient(8) is closing stdio by precaching fd to /dev/null before chroot. This is done few lines below daemon(3) function so let's not try to do that in daemon(3) function. Reviewed by: cem@ Differential Revision: https://reviews.freebsd.org/D12826 Notes: svn path=/head/; revision=325741
* Use syslog service in dhclient(8).Mariusz Zaborski2017-11-125-17/+46
| | | | | | | | | | | | | dhclient(8) is failing during boot to connect to the syslog service, because syslog daemon is started after dhclient(8). This can be reproduced by stooping syslog daemon and ktrace the dhclient or use kern.trap_enotcap sysctl and boot the machine. Using the Casper syslog service fix the problem. Reviewed by: bapt@ Differential Revision: https://reviews.freebsd.org/D12825 Notes: svn path=/head/; revision=325740
* Introduce syslog service for Casper.Mariusz Zaborski2017-11-126-0/+282
| | | | | | | | | | | | | | syslog in libc secretly reconnects to the daemon. Another issue is that we don't have any information from openlog(3) if we succeeded to open log or not so we don't know if we are ready to enter cabability mode. Because all of that we decided we need a syslog service for Caspser. Reviewed by: bapt@ Differential Revision: https://reviews.freebsd.org/D12824 Notes: svn path=/head/; revision=325739
* Remove the special character definitions files for eqn(1)Baptiste Daroussin2017-11-122-90/+2
| | | | | | | This files hasn't been used since groff(1) was introduced in base 23 years ago. Notes: svn path=/head/; revision=325738
* Update to 2017.10.21Baptiste Daroussin2017-11-121-82/+287
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=325737
* We return a pointer when we are using cap_init() or cap_service_open()Mariusz Zaborski2017-11-122-1/+3
| | | | | | | | | | | | function, so check if cap_chanel_t is NULL is not enough. Casper with a normal libc will still fail in capability mote so let's not enter capability mode without casper support when we need to resolve DNS. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D12823 Notes: svn path=/head/; revision=325736
* libkvm: fix lib32 build.Will Andrews2017-11-121-0/+1
| | | | Notes: svn path=/head/; revision=325735
* amd64: stop nesting preemption counter in spinlock_enterMateusz Guzik2017-11-121-3/+4
| | | | | | | Discussed with: jhb Notes: svn path=/head/; revision=325734
* Use passed thread pointer instead of curthread in sys_sched_yieldMateusz Guzik2017-11-121-2/+2
| | | | | | | No functional changes. Notes: svn path=/head/; revision=325733
* libkvm: fix build failuresWill Andrews2017-11-1210-17/+39
| | | | Notes: svn path=/head/; revision=325732
* libkvm: fix 'index' shadowing.Will Andrews2017-11-121-13/+13
| | | | Notes: svn path=/head/; revision=325729
* libkvm: add kvm_walk_pages API.Will Andrews2017-11-1113-122/+740
| | | | | | | | | | | | | | | | | | | | This API allows callers to enumerate all known pages, including any direct map & kernel map virtual addresses, physical addresses, size, offset into the core, & protection configured. For architectures that support direct map addresses, also generate pages for any direct map only addresses that are not associated with kernel map addresses. Fix page size portability issue left behind from previous kvm page table lookup interface. Reviewed by: jhb Sponsored by: Backtrace I/O Differential Revision: https://reviews.freebsd.org/D12279 Notes: svn path=/head/; revision=325728
* bhyve: avoid applying capsicum capabilities to file that was not openedBartek Rutkowski2017-11-111-10/+14
| | | | | | | | | | | | | | | | | When using -l option targeting file that can't be opened (ie. nmdm module is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum capabilities to a file that was not opened. Enclose that code in an if statement and only run it on correctly opened descriptor also providing meaningful message in case of an error. Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Reviewed by: grehan, emaste Sponsoied by: Mysterious Code Ltd. Differential Revision: D12985 Notes: svn path=/head/; revision=325727
* Avoid locking and refing in sysctl_kern_proc_args if possible.Mateusz Guzik2017-11-111-1/+14
| | | | | | | Turns out the sysctl is called a lot e.g. by pkg-static. Notes: svn path=/head/; revision=325726
* sysctl: try to avoid malloc in name2oidMateusz Guzik2017-11-111-3/+8
| | | | | | | | name2oid is called all the time and passed names are almost always very short (< 16 characters). Notes: svn path=/head/; revision=325725
* Implement missing KDGETMODE IOCTL in VT.Hans Petter Selasky2017-11-111-0/+4
| | | | | | | | | Obtained from: Johannes Lundberg <yohanesu75@gmail.com> Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=325724
* find(1): Don't treat statfs() error as fatal in f_fstype, which can happenXin LI2017-11-111-2/+7
| | | | | | | | | | | | | | | when a directory is removed in the middle of find. Instead of a full err(), allow find to continue, plus print a warning with exitstatus set when appropriate. Reported by: 100.chksetuid via gordon Reviewed by: jilles MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D13024 Notes: svn path=/head/; revision=325723
* Use pfind_any in linux_rt_sigqueueinfo and kern_sigqueueMateusz Guzik2017-11-112-6/+3
| | | | Notes: svn path=/head/; revision=325722
* Add pfind_anyMateusz Guzik2017-11-114-12/+27
| | | | | | | | It looks for both regular and zombie processes. This avoids allproc relocking previously seen with pfind -> zpfind calls. Notes: svn path=/head/; revision=325721
* Avoid allproc lock in pfind if curproc->pid == pidMateusz Guzik2017-11-111-0/+5
| | | | Notes: svn path=/head/; revision=325720
* Remove useless proc lookup from sysctl_out_procMateusz Guzik2017-11-111-21/+3
| | | | Notes: svn path=/head/; revision=325719
* Fix typo in filename.Warner Losh2017-11-111-0/+0
| | | | | | | Noticed by: Shawn Webb Notes: svn path=/head/; revision=325718
* Remove __unused attributed on arguments that are actually usedBaptiste Daroussin2017-11-111-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=325717
* Fix some nroff style issueBaptiste Daroussin2017-11-111-13/+6
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=325716
* vmstat: fix duplicate key in libxo outputAllan Jude2017-11-111-1/+1
| | | | | | | | | | | | | | In the libxo output from vmstat, the number of pages that have been paged out uses the same key name as the number of times pages have been paged. Appears to have been a typo or copy-pasto. PR: 222198 Submitted by: Yavuz Tanriverdi <stemix@gmail.com> Reviewed by: phil, garga Differential Revision: https://reviews.freebsd.org/D12395 Notes: svn path=/head/; revision=325715
* Follow up on zstd updateBaptiste Daroussin2017-11-111-1/+6
| | | | Notes: svn path=/head/; revision=325714
* Update to zstd 1.3.2Baptiste Daroussin2017-11-11163-4678/+11464
|\ | | | | | | Notes: svn path=/head/; revision=325713
| * import zstd 1.3.2vendor/zstd/1.3.2Baptiste Daroussin2017-11-09163-4677/+11463
| | | | | | | | | | Notes: svn path=/vendor/zstd/dist/; revision=325597 svn path=/vendor/zstd/1.3.2/; revision=325598; tag=vendor/zstd/1.3.2
* | Remove release and acquire semantics when accessing the "state" field of theHans Petter Selasky2017-11-113-8/+7
| | | | | | | | | | | | | | | | | | | | | | LinuxKPI task struct. Change type of "state" variable from "int" to "atomic_t" to simplify code and avoid unneccessary casting. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=325708
* | Mask away return codes from del_timer() and del_timer_sync() becauseHans Petter Selasky2017-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | they are not the same like in Linux. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=325707
* | rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNERMateusz Guzik2017-11-111-2/+1
| | | | | | | | Notes: svn path=/head/; revision=325706