summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf
Commit message (Collapse)AuthorAgeFilesLines
* MFC r320989:kib2017-07-171-9/+10
| | | | Language improvements.
* MFC r320658:kib2017-07-111-3/+7
| | | | When reporting undefined symbol, note the version, if specified.
* MFC r320665:delphij2017-07-081-3/+3
| | | | | | | In open_binary_fd: when using buffer size for strl* and snprintf, always use >= instead of > to avoid truncation. releng/11.1 candidate.
* MFC r320318:kib2017-07-051-1/+5
| | | | Use address space guard to implement inter-segment gap.
* MFC r318954vangyzen2017-06-015-25/+0
| | | | | | | | | rtld: fix warnings about redundant declarations Fix warnings about redundant declarations in rtld when libthr in increased to WARNS=6. Sponsored by: Dell EMC
* MFC r319137:kib2017-06-011-4/+5
| | | | Correct explanation of the dynamic tokens handling.
* MFC r319138:kib2017-06-011-0/+71
| | | | Document direct execution mode for rtld.
* MFC r318446:kib2017-05-291-3/+8
| | | | Update my copyright, note The FreeBSD Foundation involvement.
* MFC direct execution mode for rtld.kib2017-05-291-19/+243
| | | | | | | | | | | | | | | | | | | | MFC r318313: Make ld-elf.so.1 directly executable. MFC r318352 (by jonathan): Rename rtld's parse_libdir to parse_integer. MFC r318380: Pretend that there is some security when executing in direct mode. MFC r318431 (by jonathan): Allow rtld direct-exec to take a file descriptor. MFC r318445: Fix style, add static keyword before static function definition. MFC r318739: For ld.so direct execution mode, implement -p option.
* MFC r318312:kib2017-05-291-0/+2
| | | | Fix the AT_EXECFD functionality.
* MFC r314833rgrimes2017-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Convert absolute links to relative links. Style.Makefile(9) has been ignored to produce minimal diffs. MFC r314837 The relative symlink fix causes downstream issues for EMC DELL Isilon so revert the relative symlink fix pending a better solution. Reported by: ngie MFC r315091 Revert r314833 until the problem with INSTALL_RSYMLINKS can be found as it appears to break arm release builds. PR: 217705 Reported by: cyclaero@gmail.com Approved by: grehan (mentor)
* MFC r318256:kib2017-05-201-23/+10
| | | | Style.
* MFC r312764:andrew2017-04-201-8/+16
| | | | | | | | Pull the R_AARCH64_TLSDESC code out into a common function and use them in both the plt and non-plt case. This fixes an issue where libraries built with LLD can fail with "Unhandled relocation 1031"
* MFC r315040asomers2017-04-023-0/+3
| | | | | | | | | | | Increase WARNS for rtld-elf tests 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
* MFC r315331:kib2017-03-2921-66/+88
| | | | | | | | | | Implement LD_BIND_NOT knob for rtld. MFC r315337: Disable LD_BIND_NOT for setugid processes. MFC r315429 (by jilles): Document that LD_BIND_NOT is unset for setugid processes.
* MFC r309068 (by jhb):kib2017-03-292-4/+15
| | | | Fix _mips_rtld_bind() to handle ELF filters.
* MFC r314973:kib2017-03-161-25/+33
| | | | Avoid bind lock recursion.
* MFC r313494:kib2017-02-231-8/+12
| | | | Handle protected symbols in rtld.
* MFC r310420, r310421, r310422:markj2017-02-032-19/+81
| | | | Fix races and logic errors around dlclose().
* MFC r312288: rtld: do not rely on a populated GOT on amd64emaste2017-01-262-2/+14
| | | | | | | | | | | | | | | | | | On rela architectures GNU BFD ld and gold store the relocation addend in GOT entries (in addition to the relocation's r_addend field). rtld previously relied on this to access its own _DYNAMIC symbol in order to apply its own relocations. However, recording addends in the GOT is not specified by the ABI, and some versions of LLVM's LLD linker leave the GOT uninitialized on rela architectures. BFD ld does not populate the GOT on sparc64, and sparc64 rtld has a machine-dependent rtld_dynamic_addr() function that returns the _DYNAMIC address. Use the same approach on amd64, obtaining the %rip- relative _DYNAMIC address following a suggestion from Rafael EspĂ­ndola. Architectures other than amd64 should be addressed in future work.
* MFC r311886:kib2017-01-241-24/+29
| | | | | | Fix acquisition of nested write compat rtld locks. PR: 215826
* MFC r311984:kib2017-01-191-8/+20
| | | | | For the main binary, postpone enforcing relro read-only protection until copy relocations are done.
* MFC r311879:kib2017-01-171-4/+4
| | | | Use ANSI C definitions, update comment.
* MFC r310025:bdrewery2017-01-031-2/+2
| | | | Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().
* MFC r305148:bdrewery2017-01-032-0/+36
| | | | DIRDEPS_BUILD: Add some missing dirctories to the build.
* MFC r309411: Retire long-broken/unused static rtld supportemaste2017-01-034-19/+11
| | | | | | | | | | | | | | | | | | | rtld-elf has some vestigial support for building as a static executable. r45501 introduced a partial implementation with a prescient note that it "might never be enabled." r153515 introduced ELF symbol versioning support, and removed part of the unused build infrastructure for static rtld. GNU ld populates rela relocation addends and GOT entries with the same values, and rtld's run-time dynamic executable check relied on this. Alternate toolchains may not populate the GOT entries, which caused RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the unused check. If we want to restore static rtld support later on we ought to introduce a build-time #ifdef flag. PR: 214972
* MFC r310155:kib2016-12-191-1/+1
| | | | Fix typo.
* MFC 308456: Pass the correct flag to find_symdef() from _rtld_bind().jhb2016-12-012-3/+3
| | | | | | | | When symbol versioning was added to rtld, the boolean 'in_plt' argument to find_symdef() was converted to a bitmask of flags. The first flag added was 'SYMLOOK_IN_PLT' which replaced the 'in_plt' bool. This happened to still work by accident as SYMLOOK_IN_PLT had the value of 1 which is the same as 'true', so there should be no functional change.
* MFC r308689:kib2016-11-2320-5/+151
| | | | | | | | | | Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86. MFC r308925: Adjust r308689 to make rtld compilable with either in-tree or (hopefully) stock gcc 4.2.1 on i386 and other arches.
* MFC r308688:kib2016-11-221-1/+1
| | | | Assert that there is no unresolved symbols during rtld linking.
* MFC r308687:kib2016-11-221-1/+1
| | | | Update hint to utilize user variable.
* MFC r304016:kib2016-08-192-27/+65
| | | | Move defines common between rtld and libsysdecode into the header.
* MFC r304012:kib2016-08-191-0/+4
| | | | Fill phdr and phsize for rtld object.
* MFC r304011:kib2016-08-191-10/+6
| | | | Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.
* MFC r302908:bdrewery2016-07-221-1/+1
| | | | | | | Fix dlsym(RTLD_NEXT) handling to only return the next library in last library cases. Approved by: re (gjb)
* Fix race for incrementally rebuilding VERSION_MAP.bdrewery2016-07-031-2/+1
| | | | | | | | | | | | | | The dependency is needed in PROG_FULL since only the build of PROG_FULL is using the LDFLAGS and depending on VERSION_MAP. This was not a problem with MK_DEBUG_FILES==no since it only builds PROG. This should probably be using bsd.lib.mk instead [1] Reported by: swills, gjb Reviewed by: emaste Noted by: rgrimes [1] Sponsored by: EMC / Isilon Storage Division Approved by: re (kib)
* Fix issues found by Coverity in the rtld-elf.c:gethints().kib2016-05-251-7/+28
| | | | | | | | | | | | | | | | Check that the dirlist path string specification does not cause overflow and is fully contained in the hints file. Check that the dirlist string is nul-terminated. Make 'hdr' static variable, so that hdr.dirlistlen is available when hints cached value is used on next function calls. Reset hdr.dirlistlen to zero if error was detected, so that allocations use reasonable size. Use 'hints', and not 'p' in the body, since p is only initialized on the first call. Reported and reviewed by: truckman (previous version) Sponsored by: The FreeBSD Foundation CIDs: 1006503, 1006504, 1006676, 1008488, 1007263 MFC after: 2 weeks
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-043-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* libexec: minor spelling fixes in comments.pfg2016-05-012-2/+2
| | | | No functional change.
* rtld-elf: use our roundup2() macro when param.h is available.pfg2016-04-191-2/+2
|
* rtld-elf: use NULL instead of zero for pointers.pfg2016-04-195-5/+5
|
* MFHgjb2016-04-041-0/+3
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * WITHOUT_TOOLCHAIN: Fix build of rtld.bdrewery2016-03-311-0/+3
| | | | | | | | | | | | | | | | | | | | MK_TOOLCHAIN==no disables building and installing of pic archives. c_pic.a is still needed for rtld though so force it to build in lib/libc and link directly to the objdir version of it for rtld. Somehow this has been broken since r148725. Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-101-0/+19
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-091-0/+19
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
| * Fix handling of DT_TEXTREL for an object with more than one read-onlykib2016-03-023-19/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | segment. According to gABI spec, presence of the tag indicates that dynamic linker must be prepared to handle relocations against any read-only segment, not only the segment which we, somewhat arbitrary, declared the text. For each read-only segment, add write permission before relocs are processed, and return to the mapping mode requested by the phdr, after relocs are done. Reported, tested, and reviewed by: emaste PR: 207631 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | MFHgjb2016-03-023-19/+42
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-03-021-1/+1
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Convert casperd(8) daemon to the libcasper.oshogbo2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After calling the cap_init(3) function Casper will fork from it's original process, using pdfork(2). Forking from a process has a lot of advantages: 1. We have the same cwd as the original process. 2. The same uid, gid and groups. 3. The same MAC labels. 4. The same descriptor table. 5. The same routing table. 6. The same umask. 7. The same cpuset(1). From now services are also in form of libraries. We also removed libcapsicum at all and converts existing program using Casper to new architecture. Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste Partially reviewed by: drysdale@google.com, bdrewery Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4277
* | MFHgjb2016-02-181-0/+1
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud