aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Add supporting changes for `Add limited sandbox capability to "make check"`Enji Cooper2017-08-143-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-tests/... changes: - Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration and propagate the appropriate environment down to *.test.mk. tests/... changes: - Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner, since tests/... is a special subdirectory tree compared to the others. MFC after: 2 months MFC with: r322511 Reviewed by: arch (silence), testing (silence) Differential Revision: D12014 Notes: svn path=/head/; revision=322515
| * Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-023-0/+3
| | | | | | | | | | | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* | Support for v1.10 (latest) of RISC-V privilege specification.Ruslan Bukin2017-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New version is not compatible on supervisor mode with v1.9.1 (previous version). Highlights: o BBL (Berkeley Boot Loader) provides no initial page tables anymore allowing us to choose VM, to build page tables manually and enable MMU in S-mode. o SBI interface changed. o GENERIC kernel. FDT is now chosen standard for RISC-V hardware description. DTB is now provided by Spike (golden model simulator). This allows us to introduce GENERIC kernel. However, description for console and timer devices is not provided in DTB, so move these devices temporary to nexus bus. o Supervisor can't access userspace by default. Solution is to set SUM (permit Supervisor User Memory access) bit in sstatus register. o Compressed extension is now turned on by default. o External GCC 7.1 compiler used. o _gp renamed to __global_pointer$ o Compiler -march= string is now in use allowing us to choose required extensions (compressed, FPU, atomic, etc). Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11800 Notes: svn path=/head/; revision=322361
* | o Replace __riscv__ with __riscvRuslan Bukin2017-08-071-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 Notes: svn path=/head/; revision=322168
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-023-9/+3
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* hyperv: Add VF bringup scripts and devd rules.Sepherosa Ziehau2017-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How network VF works with hn(4) on Hyper-V in non-transparent mode: - Each network VF has a cooresponding hn(4). - The network VF and the it's cooresponding hn(4) have the same hardware address. - Once the network VF is up, e.g. ifconfig VF up: o All of the transmission should go through the network VF. o Most of the reception goes through the network VF. o Small amount of reception may go through the cooresponding hn(4). This reception will happen, even if the the cooresponding hn(4) is down. The cooresponding hn(4) will change the reception interface to the network VF, so that network layer and application layer will be tricked into thinking that these packets were received by the network VF. o The cooresponding hn(4) pretends the physical link is down. - Once the network VF is down or detached: o All of the transmission should go through the cooresponding hn(4). o All of the reception goes through the cooresponding hn(4). o The cooresponding hn(4) fallbacks to the original physical link detection logic. All these features are mainly used to help live migration, during which the network VF will be detached, while the network communication to the VM must not be cut off. In order to reach this level of live migration transparency, we use failover mode lagg(4) with the network VF and the cooresponding hn(4) attached to it. To ease user configuration for both network VF and non-network VF, the lagg(4) will be created by the following rules, and the configuration of the cooresponding hn(4) will be applied to the lagg(4) automatically. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11635 Notes: svn path=/head/; revision=321762
* Allow to specify targets by absolute paths in libmap.conf.Konstantin Belousov2017-07-271-9/+10
| | | | | | | | | Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi> PR: 221032 MFC after: 2 weeks Notes: svn path=/head/; revision=321607
* Language improvements.Konstantin Belousov2017-07-141-9/+10
| | | | | | | | | Submitted by: wblock MFC after: 3 days Differential revision: https://reviews.freebsd.org/D10826 Notes: svn path=/head/; revision=320989
* In open_binary_fd: when using buffer size for strl* and snprintf,Xin LI2017-07-051-3/+3
| | | | | | | | | | | always use >= instead of > to avoid truncation. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D11474 MFC after: 3 days Notes: svn path=/head/; revision=320665
* When reporting undefined symbol, note the version, if specified.Konstantin Belousov2017-07-041-3/+7
| | | | | | | | | | | | Use the standard syntax of name@version, I do not expect a confusion due to unlikely possibility of the name containing the '@' character. Requested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=320658
* Add deprecation notices for all rcmd toolsAllan Jude2017-07-042-2/+20
| | | | | | | | | | | Submitted by: bcr Reviewed by: emaste, bapt, jhl MFC after: immediate Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11471 Notes: svn path=/head/; revision=320644
* atf-sh(3): document atf_init_test_cases(3) fullyEnji Cooper2017-06-301-0/+1
| | | | | | | | | | The function was missing from the NAME/SYNOPSIS sections. Add a manpage link to complete the documentation reference. MFC after: 1 month Notes: svn path=/head/; revision=320491
* Use strlcpy() instead of strncpy() and nul-terminating.Xin LI2017-06-281-5/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=320433
* A little tweak for performanceJohn W. De Boskey2017-06-271-3/+2
| | | | | | | | | Reviewed by: adrian Approved by: rmacklem (mentor) MFC after: 3 weeks Notes: svn path=/head/; revision=320406
* Use address space guard to implement inter-segment gap.Konstantin Belousov2017-06-241-1/+4
| | | | | | | | | | | | | Rtld checks and use old MAP_ANON/PROT_NONE method of creating gap if running on old kernel. Reviewed by: alc, markj Tested by: pho, Qualys Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=320318
* Add MLINKS for atf-sh(3) to each of the functions it implementsEnji Cooper2017-06-071-1/+23
| | | | | | | | | | | This hopefully will make atf-sh(3) easier to understand for newcomers, without having to go through the atf-sh(3) level of indirection. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319662
* Revert r319659Enji Cooper2017-06-071-1/+0
| | | | | | | | | | | | I missed the fact that atf-sh(3) already documents atf_check(3). I'll be adding an manpage link for that instead in the next commit. MFC after: 1 week MFC with: r319659 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319660
* Add an MLINK for atf_check(1) -> atf-check(1)Enji Cooper2017-06-071-0/+1
| | | | | | | | | | | | This is being done to make the documentation for atf-check(1) easier to find/more intuitive for new users, because atf_check is the atf-run(1) shell version of the standalone atf-check(1) command, which is used in atf-sh(3) test programs. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319659
* Document direct execution mode for rtld.Konstantin Belousov2017-05-291-0/+71
| | | | | | | | | | Reviewed by: emaste, jonathan (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D10826 Notes: svn path=/head/; revision=319138
* Correct explanation of the dynamic tokens handling.Konstantin Belousov2017-05-291-4/+5
| | | | | | | | | Reviewed by: emaste, jonathan Sponsored by: The FreeBSD Foundation X-Differential Revision: https://reviews.freebsd.org/D10826 Notes: svn path=/head/; revision=319137
* rtld: fix warnings about redundant declarationsEric van Gyzen2017-05-265-25/+0
| | | | | | | | | | | | | Fix warnings about redundant declarations in rtld when libthr in increased to WARNS=6. Reviewed by: kib MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10934 Notes: svn path=/head/; revision=318954
* For ld.so direct execution mode, implement -p option: search for theKonstantin Belousov2017-05-231-9/+49
| | | | | | | | | | | binary in $PATH. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10790 Notes: svn path=/head/; revision=318739
* Update my copyright, note The FreeBSD Foundation involvement.Konstantin Belousov2017-05-181-3/+8
| | | | | | | | | | While tweaking copyright block, switch to use __FBSDID for tag. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=318446
* Fix style [1], add static keyword before static function definition.Konstantin Belousov2017-05-181-1/+2
| | | | | | | | | Noted by: bapt [1] Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=318445
* Fix some nroff syntax in rtld.1.Jonathan Anderson2017-05-181-1/+1
| | | | | | | | | When I originally documented the LD_LIBRARY_PATH_FDS environment variable, I used `.Ev` rather than `.It Ev` to introduce it; this led to the documentation being embedded in the previous paragraph (LD_LIBRARY_PATH). Notes: svn path=/head/; revision=318432
* Allow rtld direct-exec to take a file descriptor.Jonathan Anderson2017-05-171-17/+109
| | | | | | | | | | | | | | | | | | When executing rtld directly, allow a file descriptor to be explicitly specified rather than opened from the given path. This, together with the LD_LIBRARY_PATH_FDS environment variable, allows dynamically-linked applications to be executed from within capability mode. Also add some rudimentary argument parsing (without pulling in getopt or the like) to accept this file descriptor, a help (-h) option and a basic usage string. Reviewed by: kib Sponsored by: NSERC, RDC Differential Revision: https://reviews.freebsd.org/D10751 Notes: svn path=/head/; revision=318431
* Pretend that there is some security when executing in direct mode.Konstantin Belousov2017-05-161-0/+38
| | | | | | | | | | | | | Do not allow direct exec if we the process is suid. Try to follow Unix permission checks for DACs, ignore ACLs. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10750 Notes: svn path=/head/; revision=318380
* Rename rtld's parse_libdir to parse_integer.Jonathan Anderson2017-05-161-12/+13
| | | | | | | | | | | | | This is a more accurate name, as the integer doesn't have to be a library directory descriptor. It is also a prerequisite for more argument parsing coming in the near future (e.g., parsing explicit binary descriptors). Reviewed by: kib MFC after: 2 weeks Sponsored by: NSERC Notes: svn path=/head/; revision=318352
* Make ld-elf.so.1 directly executable.Konstantin Belousov2017-05-151-6/+58
| | | | | | | | | | | | | | | | Check if passed phdr is actually phdr of the interpreter itself, and decide that this is the case of direct execution. In this case, the binary to activate is specified in the argv[1]. After opening it, shift down on-stack structure with argv, env and aux vectors to emulate execution of the binary and not of the interpreter. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10701 Notes: svn path=/head/; revision=318313
* Fix the AT_EXECFD functionality.Konstantin Belousov2017-05-151-0/+2
| | | | | | | | | | | | | | | If the mapped object is linked at specific address, we must obey it. If AT_EXECFD is not used, only in-kernel ELF image activator needed to keep the mapping address, since only binaries are linked at the fixed address, and binaries are mapped by kernel in this case. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D10701 Notes: svn path=/head/; revision=318312
* In _rtld(), reorder local declarations to compact the block andKonstantin Belousov2017-05-131-23/+10
| | | | | | | | | | | partially sort them by style(9). Move locals declarations from nested blocks into the block at function start. Discussed with: emaste MFC after: 1 week Notes: svn path=/head/; revision=318256
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+1
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Improve blacklist support before upgrading libblacklistKurt Lidl2017-05-062-3/+5
| | | | | | | | | | | | | | | The locally declared enum of blacklistd actions needs to be hidden when the soon to be committed changes to libblacklist are brought into the tree. Fix the type of the "msg" parameter to match the library. There should be no functional changes. MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=317862
* Fix markup in gettytab(5).Edward Tomasz Napierala2017-05-041-36/+36
| | | | | | | | | | Reviewed by: bapt MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10476 Notes: svn path=/head/; revision=317801
* - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeterGleb Smirnoff2017-04-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in place. To do per-cpu stats, convert all fields that previously were maintained in the vmmeters that sit in pcpus to counter(9). - Since some vmmeter stats may be touched at very early stages of boot, before we have set up UMA and we can do counter_u64_alloc(), provide an early counter mechanism: o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, so that at early stages of boot, before counters are allocated we already point to a counter that can be safely written to. o For sparc64 that required a whole dummy pcpu[MAXCPU] array. Further related changes: - Don't include vmmeter.h into pcpu.h. - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, to match kernel representation. - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion. This is based on benno@'s 4-year old patch: https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html Reviewed by: kib, gallatin, marius, lidl Differential Revision: https://reviews.freebsd.org/D10156 Notes: svn path=/head/; revision=317061
* Emply contemporary function prototypes in bootpd, rather than relying onRobert Watson2017-03-264-13/+12
| | | | | | | | | | | | | locally defined K&R prototypes in .c files; use appropriate casts for pointer types now that types for arguments are available at compile time. This ensures that compilers with multiple incompatible calling conventions can select the correct calling convention for external functions. Sponsored by: DARPA, AFRL MFC after: 1 week Notes: svn path=/head/; revision=315987
* Impelemnt ttys onifexists in init.Warner Losh2017-03-221-1/+7
| | | | | | | | | | | | | | | | | | | | Implement a new init(8) option in /etc/ttys. If this option is present on the entry in /etc/ttys, the entry will be active if and only if it exists. If the name starts with a '/', it will be considered an absolute path. If not, it will be a path relative to /dev. This allows one to turn off video console getty that aren't present (while running a getty on them even when they aren't the system console). Likewise with serial ports. It differs from onifconsole in only requiring the device exist rather than it be listed as one of the system consoles. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D10037 Notes: svn path=/head/; revision=315733
* Remove unused vmmeter.Gleb Smirnoff2017-03-171-2/+0
| | | | Notes: svn path=/head/; revision=315439
* rtld(1): Document that LD_BIND_NOT is unset for setugid processes.Jilles Tjoelker2017-03-161-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315429
* Disable LD_BIND_NOT for setugid processes.Konstantin Belousov2017-03-151-3/+3
| | | | | | | | | Requested by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=315337
* Implement LD_BIND_NOT knob for rtld.Konstantin Belousov2017-03-1521-65/+86
| | | | | | | | | | | | | | | | From the manpage: When set to a nonempty string, prevents modifications of the PLT slots when doing bindings. As result, each call of the PLT-resolved function is resolved. In combination with debug output, this provides complete account of all bind actions at runtime. Same feature exists on Linux and Solaris. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=315331
* Increase WARNS for rtld-elf testsAlan Somers2017-03-113-0/+3
| | | | | | | | | | | | ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 Notes: svn path=/head/; revision=315040
* Avoid bind lock recursion.Konstantin Belousov2017-03-091-25/+33
| | | | | | | | | | | | | | When dlclose(3) unloads an object with filtees, it recursively calls dlclose(3) on each filtee in free_needed_filtees(). Introduce dlclose_locked() helper, called from free_needed_filtees() instead of dlclose(), and pass the bind lockstate down to avoid recursing. Reported and tested by: jhibbits Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=314973
* Convert absolute links to relative links.Rodney W. Grimes2017-03-071-1/+1
| | | | | | | | | | Style.Makefile(9) has been ignored to produce minimal diffs. Approved by: grehan (mentor) MFC after: 1 week Notes: svn path=/head/; revision=314833
* libexec: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-0411-17/+16
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314653
* 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
* Fully handle the special encoding of GOT[1] on mips64.John Baldwin2017-02-231-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MIPS ABI does not require the second GOT entry to be reserved for use by the runtime linker as on other architectures. Instead, static linkers use a special value in the second GOT entry to indicate if the entry is reserved. This value is supposed to consist of an address with the MSB set and the rest of the bits all zero which is an invalid user address. However, the old binutils currently in the tree uses the 32-bit mask value (2^31) on 64-bit MIPS instead of 2^63. This was fixed in upstream binutils in 2008 to use 2^63 on 64-bit MIPS. The first part of this change changes the runtime check in init_pltgot() to check for both values (2^31 and 2^63) when deciding whether to store the current object pointer in GOT[1] which fixes dynamic N64 binaries compiled with modern binutils. However, the initial version of this fix exposed another related bug in that _rtld_relocate_nonplt_self() was only checking for the new value (2^63) in GOT[1] and incorrectly treated GOT[1] as a local GOT entry (and did not relocate the final local GOT entry). To handle this, fix all of the places that check for GOT[1]'s status to use the same macro that checks for both values on N64. Reviewed by: kan, imp Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D9708 Notes: svn path=/head/; revision=314115
* Handle protected symbols in rtld.Konstantin Belousov2017-02-091-8/+12
| | | | | | | | | | | | | Protected symbol reference in GOT of the defining object must be resolved to itself, same as -Bsymbolic globally. Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D9317 Notes: svn path=/head/; revision=313494
* Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8)Alexey Dokuchaev2017-02-022-52/+48
| | | | | | | | | | | | | | | | | | | | | | | | | There is one capability explicitly documented in gettytab(5) as stupid: he. And it is indeed. It was meant to facilitate system hostname modification, but is hardly usable in practice because it allows very limited editing (e.g., it depends on a particular hostname length, making it non-generic). Replace it with simple implementation that treats ``he'' as POSIX extended regular expression which is matched against the hostname. If there are no parenthesized subexpressions in the pattern, entire matched string is used as the final hostname. Otherwise, use the first matched subexpression. If the pattern does not match, the original hostname is not modified. Using regex(3) gives more freedom, does not complicate the code very much, and makes a lot more sense, in turn making ``he'' less stupid and actually useful (e.g., it is now possible to obtain node or domain names from the original hostname string, without knowing it in advance). Reviewed by: jilles, manpages (wblock) Approved by: jilles (implied) Differential Revision: https://reviews.freebsd.org/D9244 Notes: svn path=/head/; revision=313107
* Remove a duplicate store when performing REL32 relocations in rtld.John Baldwin2017-01-301-1/+0
| | | | | | | | | | | | | The duplicate call to store_ptr() was added in r204687, but it should have no effect as it only stores an Elf_Sword and the later store_ptr() does a write that is at least as large if not larger. Reviewed by: jmallett Obtained from: CheriBSD (sort of) Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=313003