aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Don't explicitly specify c99 or gnu99 as the default is now gnu99.Xin LI2020-08-171-1/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=364292
* Properly disable LUA_USE_DLOPEN for bootstrap fluaKyle Evans2020-08-141-3/+0
| | | | | | | | | | | | | | | | | | | | flua does have some specific bits that will include luaconf.h, but the definition of LUA_USE_DLOPEN for those won't matter. This belongs in liblua instead. To expand on my previous commit, which was a little sparse with details, it's not really safe to allow LUA_USE_DLOPEN with host lib paths being used. The host system could have an entirely different lua version and this could cause us to crash and burn. If we want to revive this later, we need to make sure to define c module paths inside OBJDIR that are compiled against whatever version we've bootstrapped. Pointy hat: kevans Notes: svn path=/head/; revision=364227
* flua: don't allow dlopen, et al., for bootstrap fluaKyle Evans2020-08-141-2/+4
| | | | | | | | There are some logistics issues that need to be sorted out here before we can actually allow this to work. Notes: svn path=/head/; revision=364226
* flua: support "require" for binary objects in the base systemEd Maste2020-08-131-0/+2
| | | | | | | | | | Export symbols from flua, and enable dlopen. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26059 Notes: svn path=/head/; revision=364222
* When booting a system with WITHOUT_IPFILTER the following errorsCy Schubert2020-08-116-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | are encountered at boot time: rcorder: requirement `ipfs' in file `/etc/rc.d/netif' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/netif' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/netwait' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/net_watchdog' has no providers. rcorder: requirement `ipfilter' in file `/etc/rc.d/securelevel' has no providers. Listing its own requrements in BEFORE rather than use REQUIRE of non-optional scripts resolves this issue. The issue was discovered and patched by glebius at Netflix. Submitted by: glebius Reported by: glebius MFC after: 1 week Notes: svn path=/head/; revision=364133
* Load ipfilter, ipnat, and ippool rules, and start ipmon in a vnet jail.Cy Schubert2020-07-234-4/+4
| | | | | | | | | PR: 248109 Reported by: joeb1@a1poweruser.com MFC after: 2 weeks Notes: svn path=/head/; revision=363452
* rc.firewall: Merge two identical conditions into one.Mark Johnston2020-07-231-3/+0
| | | | | | | | | | | No functional change intended. PR: 247949 Submitted by: Jose Luis Duran <jlduran@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=363449
* getty appears to date from 3rd edition research unix. That's the oldest man pageWarner Losh2020-07-221-2/+2
| | | | | | | | on TUHS and its 'unix 1972' restoration effort has assembler sources that look like simpler version of what's in the 5th edition. Notes: svn path=/head/; revision=363408
* Revert that!Simon J. Gerraty2020-07-192-3/+2
| | | | Notes: svn path=/head/; revision=363351
* Oops missed Makefile.configSimon J. Gerraty2020-07-192-2/+3
| | | | Notes: svn path=/head/; revision=363350
* Include FreeBSD ABI tag note in the ELF runtime loader.John Baldwin2020-07-162-14/+3
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25306 Notes: svn path=/head/; revision=363264
* Remove excess spaces from rc.d scriptsAllan Jude2020-07-132-2/+2
| | | | | | | | | | | | | | | | | | | | The space between words is already being echoed by the space between quoted strings: % echo 'foo' 'bar' foo bar % echo 'foo' ' baz' foo baz Found in `ipfw` and `mountlate` messages. PR: 247948 Submitted by: Jose Luis Duran <jlduran@gmail.com> MFC after: 2 weeks Sponsored by: Klara Inc. Notes: svn path=/head/; revision=363142
* Add cross references betwen ttys(5) and related driversAllan Jude2020-07-111-1/+4
| | | | | | | | | | | | | | nmdm(4), ucom(4), and uart(4) PR: 247638 Submitted by: Pau Amma <pauamma@gundo.com> Reported by: 0mp MFC after: 4 weeks Sponsored by: Klara Inc. Event: July 2020 Bugathon Notes: svn path=/head/; revision=363111
* Handle non-PLT GNU IFUNC relocations in rtldLeandro Lupori2020-07-061-1/+4
| | | | | | | | | | | | | | | | In the last IFUNC related changes to rtld, the code that handled non-PLT GNU IFUNC relocations ended up getting lost. This could leave some relocations unhandled, causing crashes or misbehavior. This change restores the handling of these relocations, but now together with the other IFUNC relocations, allowing resolvers to reference external symbols. Reviewed by: kib MFC after: 2 weeks Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D25550 Notes: svn path=/head/; revision=362958
* Make the linux rc script use linrdlnk by default.Edward Tomasz Napierala2020-07-041-1/+1
| | | | | | | | | | | | This fixes Linux gettyname(3), with caveats (see PR). PR: kern/240767 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25558 Notes: svn path=/head/; revision=362935
* Fix build with recent byacc.Jung-uk Kim2020-06-241-0/+2
| | | | Notes: svn path=/head/; revision=362569
* Remove ldconfig_paths_aout from rc.conf after r362543Mateusz Piotrowski2020-06-231-2/+0
| | | | | | | | Approved by: imp Differential Revision: https://reviews.freebsd.org/D25415 Notes: svn path=/head/; revision=362550
* ldconfig: remove i386 aout invocationEd Maste2020-06-231-16/+0
| | | | | | | | | | | | | | aout support in ldconfig hasn't been required since FreeBSD 2.x. Anyone still using FreeBSD 2 shared libraries can use a FreeBSD 2 ldconfig to generate aout ldconfig hints. Reviewed by: dim, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24883 Notes: svn path=/head/; revision=362543
* network.subr: unobsolete gif_interfacesEugene Grosbein2020-06-221-3/+0
| | | | | | | | | | | | There are cases when gif_interfaces cannot be replaced with cloned_interfaces, such as tunnels with external IPv6 addresses and internal IPv4 or vice versa. Such configuration requires extra invocation of ifconfig(8) and supported with gif_interfaces only. MFC after: 1 week Notes: svn path=/head/; revision=362502
* flua: add ucl libraryRyan Moeller2020-06-222-0/+8
| | | | | | | | | | | | | | | | | | | | | | | libucl comes with a Lua library binding. Build it into flua. This lets us parse/generate config files in the various formats supported by libucl with flua. For example, the following script will detect the format of an object written to stdin as one of UCL config, JSON, or YAML and write it to stdout as pretty-printed JSON: local ucl = require('ucl') local parser = ucl.parser() parser:parse_string(io.read('*a')) local obj = parser:get_object() print(ucl.to_format(obj, 'json')) Reviewed by: kevans, pstef Approved by: mmacy (mentor) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25009 Notes: svn path=/head/; revision=362477
* rtld: Apply relro to itself.Konstantin Belousov2020-06-181-0/+1
| | | | | | | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25319 Notes: svn path=/head/; revision=362347
* rtld: Parse own phdr and notes.Konstantin Belousov2020-06-181-0/+30
| | | | | | | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25319 Notes: svn path=/head/; revision=362346
* rtld: Allow to load ET_DYN && DF_1_PIE when tracing.Konstantin Belousov2020-06-161-3/+4
| | | | | | | | | | | | | | | This makes old ldd to still work on newer tagged PIE binaries. Also move debug line for hashes before both decisions to not load are done, so that the end of digest_dynamic() processing and reason to not load or load is seen in debug trace. Noted by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=362251
* rtld: Add debug line for dlopen_object().Konstantin Belousov2020-06-161-0/+3
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=362250
* Systematically pass RTLD_LO_TRACE to load_needed_objects().Konstantin Belousov2020-06-161-2/+3
| | | | | | | | | | | Which makes all calls to load_object() to observe the flag, except the calls for preloaded DSOs. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=362249
* rtld: set osrel when in the direct exec mode.Konstantin Belousov2020-06-122-3/+32
| | | | | | | | | | | | | | | | | Rtld itself is a shared object which does not have vendor note, so after the direct exec of ld-elf.so.1 process has p_osrel set to zero. This affects the ABI of syscalls. Set osrel to the __FreeBSD_version value at compile time right after rtld identified direct exec mode. Then, switch to the osrel read from the binary note or zero if no note, right before starting calling ifunc resolvers, which is the first byte of the user code. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=362128
* Uppercase 'dso' to indicate that it is abbreviation.Konstantin Belousov2020-06-021-1/+1
| | | | | | | | | Suggested by: arichardson Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361728
* Do not allow to load ET_DYN object with DF_1_PIE flag set.Konstantin Belousov2020-06-022-0/+7
| | | | | | | | | | | | | | | | | Linkers are supposed to mark PIE binaries with DF_1_PIE, such binary cannot be correctly and usefully loaded neither by dlopen(3) nor as a dependency of other object. For instance, we cannot do anything useful with COPY relocations, among other things. Glibc already added similar restriction. Requested and reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25086 Notes: svn path=/head/; revision=361725
* rtld: Add -b option to allow to specify image name different from arg0.Konstantin Belousov2020-05-312-6/+40
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361680
* rtld: Fix indent in print_usage().Konstantin Belousov2020-05-311-9/+9
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361676
* rtld: Add -v switch to print some useful information about the rtld binary.Konstantin Belousov2020-05-312-1/+24
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361675
* rtld: Add -p switch to direct exec mode summary line.Konstantin Belousov2020-05-311-2/+2
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361672
* Add version indicators to rtld.Konstantin Belousov2020-05-263-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is wrong to relate on __FreeBSD_version, either from include/param.h, kernel, or libc, to check for rtld features. Rtld might be from newer world than the running userspace. Add special private symbols exported by rtld itself, to indicate the changes in runtime behavior, and features that cannot be otherwise detected or deduced at runtime. Note that the symbols are not exported from libc, so they intentionally cannot be linked against, and exported from the private namespace from rtld. Consumers are required to use dlsym(3). For instance, for _rtld_version_laddr_offset, user should do ptr = dlsym(RTLD_DEFAULT, "_rtld_version_laddr_offset") or even ptr = dlvsym(RTLD_DEFAULT, "_rtld_version_laddr_offset", "FBSDprivate_1.0"); Non-null ptr means that the change is present. Also add _rtld_version__FreeBSD_version indicator to report the headers version used at time of the rtld build. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24982 Notes: svn path=/head/; revision=361537
* Implement Solaris-like link_map l_refname member.Konstantin Belousov2020-05-221-0/+7
| | | | | | | | | | | The implementation is based on the public documentation, in particular dlinfo(3) from Solaris. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361398
* Convert linkmap_add() and linkmap_delete() to style(8).Konstantin Belousov2020-05-221-32/+33
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=361394
* Restore the binary compatibility for link_map l_addr.Konstantin Belousov2020-05-211-1/+2
| | | | | | | | | | | | | | | | | Keep link_map l_addr binary layout compatible, rename l_addr to l_base where rtld returns map base. Provide relocbase in newly added l_addr. This effectively reverts the patch to the initial version of D24918. Reported by: antoine (portmgr) Reviewed by: jhb, markj Tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24946 Notes: svn path=/head/; revision=361349
* Change the samantic of struct link_map l_addr member.Konstantin Belousov2020-05-201-5/+1
| | | | | | | | | | | | | | | | | | | | It previously returned the object map base address, while all other ELF operating systems return load offset, i.e. the difference between map base and the link base. Explain the meaning of the field in the man page. Stop filling the mips-only l_offs member, which is apparently unused. PR: 246561 Requested by: Damjan Jovanovic <damjan.jov@gmail.com> Reviewed by: emaste, jhb, cem (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24918 Notes: svn path=/head/; revision=361303
* Move the devmatch rc.d script before netif in the boot process.Colin Percival2020-05-161-0/+1
| | | | | | | | | | | | | Prior to this change, using lagg to aggregate wired and wireless networks was broken in the (relatively common) case where wifi drivers + firmware are loaded by devmatch, since the interface didn't exist at the time when the lagg interface was being created. Suggested by: imp MFC after: 3 days Notes: svn path=/head/; revision=361114
* Implement RTLD_DEEPBIND.Konstantin Belousov2020-05-152-0/+5
| | | | | | | | | | | PR: 246462 Tested by: Martin Birgmeier <d8zNeCFG@aon.at> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24841 Notes: svn path=/head/; revision=361073
* Remove tests for obsolete compilers in the build systemEric van Gyzen2020-05-122-7/+0
| | | | | | | | | | | | | | Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Notes: svn path=/head/; revision=360964
* Move ARM specific flags to arm/Makefile.incMichal Meloun2020-04-292-3/+2
| | | | | | | | Requested by: kib MFC with: r360463 Notes: svn path=/head/; revision=360469
* Don't allow to use FPU inside of rtld library.Michal Meloun2020-04-291-0/+3
| | | | | | | | | | | Clang10 may use FPU instructions for optimizing operations with memory blocks. But we don't want to do lengthy save/restore of all FPU registers across each rtld_start() call. MFC after: 3 week Notes: svn path=/head/; revision=360463
* rtld: ignore static TLS segments when tracing.Konstantin Belousov2020-04-222-4/+5
| | | | | | | | | | | | | | | | | For PIE binaries, ldd(1) performs dlopen(RTLD_TRACE) on the binary. It is legal for binary to use initial exec TLS mode, but when such binary (actually dso) is dlopened, we might not have enough free space in the finalized static TLS segment. Make ldd operational by skipping TLS space allocation, we are not going to execute any code from the dso anyway. Reported by: tobik PR: 245677 Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=360201
* Abort transfer if fseeko() fails.John Baldwin2020-04-211-3/+23
| | | | | | | | | | | CID: 1420215 Reviewed by: asomers MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24454 Notes: svn path=/head/; revision=360167
* Due to popular demand, revert r360102.Cy Schubert2020-04-191-7/+4
| | | | | | | Reported by: many Notes: svn path=/head/; revision=360106
* Conditionally install Kerberos rc files based on MK_KERBEROS_SCRIPTSCy Schubert2020-04-191-4/+7
| | | | | | | | | | | | | | instead of MK_KERBEROS. The reason for this change is some users prefer to build FreeBSD WITHOUT_KERBEROS, wanting to retain the Kerberos rc scripts to start/stop MIT Kerberos or Heimdal from ports. PR: 197337 Reported by: Adam McDougall <ebay at looksharp.net> Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24252 Notes: svn path=/head/; revision=360102
* Align initial-exec TLS segments to the p_vaddr % align.Konstantin Belousov2020-04-1911-33/+86
| | | | | | | | | | | | | | | This is continuation of D21163/r359634, which handled the alignment for global mode. Non-x86 arches are not handled, maintainers are welcomed. Tested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D24366 Notes: svn path=/head/; revision=360091
* sshd: Warn about missing ssh-keygen only when necessaryMateusz Piotrowski2020-04-151-7/+8
| | | | | | | | | | | | | | | | | | | | | | The sshd service is using ssh-keygen to generate missing SSH keys. If ssh-keygen is missing, it prints the following message: > /etc/rc.d/sshd: WARNING: /usr/bin/ssh-keygen does not exist. It makes sense when the key is not generated yet and cannot be created because ssh-keygen is missing. The problem is that even if the key is present on the host, the sshd service would still warn about missing ssh-keygen (even though it does not need it). Reviewed by: emaste Approved by: emaste (src) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23911 Notes: svn path=/head/; revision=359973
* yp*: fix -fno-common buildKyle Evans2020-04-061-2/+2
| | | | | | | | | | | | | | | | | This is mostly two problems spread out far and wide: - ypldap_process should be declared properly - debug is defined differently in many programs For the latter, just extern it and define it everywhere that actually needs it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the assignment at the beginning of main in favor of defining it properly. -fno-common will become the default in GCC10/LLVM11. MFC after: 3 days Notes: svn path=/head/; revision=359677
* Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments.Konstantin Belousov2020-04-044-35/+49
| | | | | | | | | | | | | | | | | | See https://sourceware.org/bugzilla/show_bug.cgi?id=24606 for the test case. See https://reviews.llvm.org/D64930 for the background and more discussion. Also this fixes another bug in malloc_aligned() where total size of the allocated memory might be not enough to fit the aligned requested block after the initial pointer is incremented by the pointer size. Reviewed by: bdragon Tested by: antoine (exp-run PR 244866), bdragon, emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D21163 Notes: svn path=/head/; revision=359634