summaryrefslogtreecommitdiff
path: root/libexec
AgeCommit message (Collapse)Author
2022-06-10Pull up following revision(s) (requested by skrll in ticket #1469):martin
libexec/ld.elf_so/arch/hppa/hppa_reloc.c: revision 1.49 libexec/ld.elf_so/arch/hppa/rtld_start.S: revision 1.14 Set DP early so that any binary functions that override others get the right value if they're called before _start. This is true of bash where it provides its own getenv. Part of port-hppa/56118: sporadic app crashes in HPPA -current
2022-05-17Pull up following revision(s) (requested by kre in ticket #1455):bouyer
libexec/mail.local/mail.local.c: revision 1.29 fix local privilege escalation due to a race condition NetBSD-SA2016-006 included an incomplete fix for CVE-2016-6253, a local privilege escalation vulnerability in mail.local(8). mail.local(8) attempts to open(2) a user's existing mailbox file to append to it. If that call fails, mail.local(8) will then issue a second open(2) call to create the file (O_CREAT). An attacker had the opportunity to create the file in question (as a symlink, or link to some other file) in between these two open(2) calls. Fix this by using O_EXCL in the 2nd open call, if the file exists when that one happens, something is going wrong, so just abort. Also, only attempt that 2nd open if the reason the first failed was that the file did not exist (this doesn't fix the issue, but it potentially saves some cycles). Thanks to Jan Schaumann for bringing this to our attention.
2021-03-05Pull up the following (all via patch), requested by mrg in ticket #1221:martin
lib/lua/bozohttpd/Makefile (apply patch) libexec/httpd/Makefile 1.30-1.31 libexec/httpd/Makefile.boot 1.7-1.9 libexec/httpd/auth-bozo.c 1.25-1.26 libexec/httpd/bozohttpd.8 1.80-1.87 libexec/httpd/bozohttpd.c 1.114-1.123,1.125-1.128 libexec/httpd/bozohttpd.h 1.61-1.68 libexec/httpd/cgi-bozo.c 1.49-1.53 libexec/httpd/content-bozo.c 1.17-1.20 libexec/httpd/daemon-bozo.c 1-.22 libexec/httpd/dir-index-bozo.c 1.33-1.34 libexec/httpd/main.c 1.23-1.27 libexec/httpd/printenv.lua 1.4-1.5 libexec/httpd/ssl-bozo.c 1.27-1.29 libexec/httpd/libbozohttpd/libbozohttpd.3 1.5-1.6 libexec/httpd/small/Makefile 1.4 libexec/httpd/testsuite/Makefile 1.14 libexec/httpd/testsuite/t16.in 1.1 libexec/httpd/testsuite/t16.out 1.1 libexec/httpd/testsuite/t17.in 1.1 libexec/httpd/testsuite/t17.out 1.1 libexec/httpd/testsuite/t18.in 1.1 libexec/httpd/testsuite/t18.out 1.1 Update to bozohttpd 20210227. Apply lua build fix (no blocklist support on this branch). changes in bozohttpd 20210227: o new support for content types: .tar.bz2, .tar.xz, .tar.lz, .tar.zst, .tbz2, .txz, .tlz, .zipx, .xz, .zst, .sz, .lz, .lzma, .lzo, .7z, .lzo, .cab, .dmg, .jar, and .rar. should fix netbsd PR#56026: MIME type of .tar.xz file on ny{cdn,ftp}.NetBSD.org is invalid changes in bozohttpd 20210211: o fix various NULL derefs from malformed headers. mostly from <emily@ingalls.rocks>. o fix memory leaks in library interface: add bozo_cleanup(). changes in bozohttpd 20201014: o also set -D_GNU_SOURCE in Makefile.boot. from hadrien.lacour@posteo.net. o fix array size botch (assertion, not exploitable.) from martin@netbsd.org. o also match %2F as well as %2f. from leah@vuxu.org. o many manual and help fixes. clean ups for higher lint levels, consistency/style clean ups. various option fixes including made -f imply -b. from <henrik@gulbra.net> for freebsd. changes in bozohttpd 20200912: o add .m4a and .m4v file extensions. changes in bozohttpd 20200820: o make this work on sun2 by reducing mmap window there. o fix SSL shutdown sequence. from spz@netbsd.org. o add readme support to directory indexing. from jmcneill@netbsd.org o add blocklist(8) support. from jruoho@netbsd.org.
2020-11-19Pull up following revision(s) (requested by hannken in ticket #1134):martin
libexec/httpd/bozohttpd.c: revision 1.124 Bozohttpd clobbers files greater than 4GB on 32bit archs. Make sure the alignment mask derived from pagesize is an off_t.
2020-05-13Pull up following revision(s) (requested by chs in ticket #907):martin
libexec/ld.elf_so/rtld.c: revision 1.205 libexec/ld.elf_so/rtld.h: revision 1.140 libexec/ld.elf_so/symbols.map: revision 1.3 libexec/ld.elf_so/symbols.map: revision 1.4 lib/libc/gen/pthread_atfork.c: revision 1.13 lib/libc/gen/pthread_atfork.c: revision 1.14 libexec/ld.elf_so/rtld.h: revision 1.139 libexec/ld.elf_so/rtld.c: revision 1.204 Introduce intermediate locking for fork, so that the dynamic linker is in a consistent state. This most importantly avoids races between dlopen and friends and fork, potentially resulting in dead locks in the child when it itself tries to acquire locks. Rename __atomic_fork to __locked_fork and give it &errno as argument. rtld and libc use different storage, so the initial version would incorrectly report the failure reason for fork(). There is still a small race condition inside ld.elf_so as it doesn't use thread-safe errno internally, but that's a more contained internal issue.
2020-03-08Pull up following revision(s) (requested by thorpej in ticket #758):martin
libexec/ld.elf_so/map_object.c: revision 1.61 libexec/ld.elf_so/headers.c: revision 1.68 libexec/ld.elf_so/rtld.c: revision 1.203 PT_GNU_RELRO segments are arranged such that their vaddr + memsz ends on a linker common page size boundary. However, if the common page size used by the linker is less than the VM page size being used by the kernel, this can end up in the middle of a VM page and when the region is write- protected, this can cause objects in neighboring .data to get incorrectly write-protected, resulting in a crash. Avoid this situation by calculating the end of the RELRO region not by rounding memsz up to the VM page size, but rather by adding vaddr + memsz and then truncating to the VM page size. Fixes PR toolchain/55043. XXX pullup-9
2019-12-09Pull up following revision(s) (requested by uwe in ticket #535):martin
libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.60 libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.59 Resolve ADDR16_LO, ADDR16_HI, and ADDR16_HA relocs. Recent GNU ld does not resolve them statically if the reloc is in a writable section and the symbol is not already referenced from text. Use existing lo() and hi() macros. Same object code is generated.
2019-12-09Pull up following revision(s) (requested by uwe in ticket #534):martin
libexec/ld.elf_so/rtld.c: revision 1.201 _rtld_relro - fix debug printf format for a size_t argument
2019-11-26Pull up following revision(s) (requested by nakayama in ticket #469):martin
lib/libc/tls/tls.c: revision 1.10 lib/libc/tls/tls.c: revision 1.11 lib/libc/tls/tls.c: revision 1.12 lib/libc/tls/tls.c: revision 1.13 libexec/ld.elf_so/tls.c: revision 1.13 libexec/ld.elf_so/tls.c: revision 1.14 libexec/ld.elf_so/Makefile: revision 1.142 lib/libc/tls/Makefile.inc: revision 1.3 usr.bin/ldd/Makefile.elf: revision 1.6 PR 54093: Align static TLS area to max_align_t. Use alignof and not size_t for platforms with non-natural base alignments. Mirror the ld.elf_so logic for handling aligning the TLS size. Most noticable, recompute the start of the TLS area for variant I relative to the TCB. This makes a difference when the segment size and base alignment don't agree. Fix PR/54074 and PR/54093 completely. More similar to the ld.elf_so logic, it is necessary to align with p_align first. Also, invert the #ifdef condition for consistency. Should fix regression for static linking binaries: http://releng.netbsd.org/b5reports/sparc/commits-2019.11.html#2019.11.10.23.39.03 http://releng.netbsd.org/b5reports/sparc64/commits-2019.11.html#2019.11.16.04.10.33
2019-09-18Pull up following revision(s) (requested by kamil in ticket #209):martin
libexec/ld.elf_so/rtld.c: revision 1.198 Return the ELF loader dl_phdr_info information for dl_iterate_phdr(3) Sync the behavior of dl_iterate_phdr(3) with Linux/FreeBSD/OpenBSD.
2019-09-02Pull up following revision(s) (requested by brad in ticket #110):martin
libexec/lfs_cleanerd/lfs_cleanerd.c: revision 1.59 libexec/lfs_cleanerd/lfs_cleanerd.8: revision 1.19 sbin/resize_lfs/resize_lfs.c: revision 1.15 usr.sbin/puffs/rump_lfs/rump_lfs.c: revision 1.19 libexec/lfs_cleanerd/lfs_cleanerd.c: revision 1.60 lib/libutil/getdiskrawname.c: revision 1.6 tests/fs/common/fstest_lfs.c: revision 1.7 Use getdiskrawname to find the device name. Reviewed by Christos - Teach getdiskrawname and getdiskcookedname about zvols. Reviewed by Christos - Add support for passing the raw device name separate from the filesystem. This is useful in the case where the cleaner is compiled into code, such as rump_lfs and the ATF tests. This helps to fix bin/54488 - The cleaner is compiled into rump_lfs and executed as a thread. Pass in the raw device using the new -J option. This avoids the use of getdiskrawname which is not particularly rump safe in this context and insures that the rump container device is used for cleaning, not the outer device.
2019-09-01Pull up following revision(s) (requested by rmind in ticket #140):martin
external/bsd/libnv/lib/Makefile: revision 1.3 usr.sbin/npf/npfd/Makefile: revision 1.7 lib/libnpf/Makefile: revision 1.11 lib/libnpf/Makefile: revision 1.12 libexec/identd/Makefile: revision 1.18 usr.sbin/npf/npfctl/Makefile: revision 1.14 lib/npf/mod.mk: revision 1.8 external/bsd/libnv/lib/srcs.mk: revision 1.1 libnpf fix: link the library itself to libnv; libnpf users should not be expected to assume this dependency. Move common parts into a makefile fragment usable from elsewhere. Suggested by mrg. Include libnv directly into this library
2019-08-16Pull up following revision(s) (requested by kamil in ticket #61):martin
libexec/telnetd/telnetd.c: revision 1.56 libexec/telnetd/sys_term.c: revision 1.49 telnetd: Stop defining the same variables concurrently in bss and data auth_level and require_secure_login were defined in two places: - global.c that picked it from headers and removed 'extern' - telnetd.c that initialized it to 0 line was defined twice: in global.c and sys_term.c with a non-zero value. Remove the definition and initialization from sys_term.c and initialize the variable early in main(). Detected during the build of telned with Address Sanitizer (MKSANITIZER). Reviewed by <mrg>
2019-07-15Tweak markup some more.uwe
2019-07-12Improve (hopefully) mark up of the capabilities tables.uwe
2019-07-12Use proper markup instead of .Em to refer to capabilities, structureuwe
memebers, etc in the text (but not in the tables yet, as those require more rework).
2019-07-11Merge lines. Fixes display problem noted in PR 54361 by he@wiz
2019-04-15r_symndx is no longer declared, use symnum and initialize it before use.maya
Completes the changes in the commit: "Replace COMBREL with just-in-time check in _rtld_relocate_nonplt_objects." http://mail-index.netbsd.org/source-changes/2017/06/19/msg085496.html
2019-04-15$ORIGIN support is now enabled.maya
Thanks martin for the heads up.
2019-04-15Typo: s/a indirection/an indirection/abhinav
2019-04-14Use more Dv.wiz
2019-04-14Note that we now search DT_RUNPATH paths as well.maya
2019-04-14undo previous unlock/relock; it is not needed now that we added the tls modelchristos
declaration to all externs in jemalloc (suggested by joerg@)
2019-04-13Fix c++ exceptions on arm; jemalloc calls _rtld_tls_get_addr from insidechristos
dl_iterate_phdr, so we need to unlock and relock.
2019-04-13Do not compile __tls_get_addr() into ldd(1), which fixes ldd(1) crashingrin
on arm after switching to new jemalloc. jemalloc invokes __tls_get_addr() under some condition. If anything other than ld.elf_so nor libc exports it, inconsistency arises as a result.
2019-04-03Disable optimization for rtld.c on the vax with gcc-7.christos
2019-03-29Account for cgihandler being set when counting the number of CGI environmentmartin
headers we are about to set. Avoids an assertion failure (and overruninng the array) later.
2019-03-27add $NetBSD$mrg
2019-03-08on m68010 set BOZO_WRSZ to 16k and BOZO_WRSZ to 64k.mrg
2019-02-28call this bozohttpd 20190228, and merge the CHANGES entries from themrg
previous release.
2019-02-28add ssl specific timeout value (30s). if SSL_accept() doesn'tmrg
work with in this timeout value, ssl setup now fails. mostly different from, but inspired from the patch in PR 50655
2019-02-04- bump buffer sizes to avoid potential truncation issuesmrg
2019-02-03- add or adjust /* FALLTHROUGH */ where appropriatemrg
- add __unreachable() after functions that can return but won't in this case, and thus can't be marked __dead easily
2019-01-29clarify the fd used for blacklisting.lukem
Use STDIN_FILENO instead of 0 as the fd to blacklist_r(), since we use the former in ftpd.c
2019-01-29NetBSD-ftpd 20180428lukem
Update version to "NetBSD-ftpd 20180428" for changes: - Fix violations of the sequence point rule. - Check that stat and fstat succeed. - Support blacklistd(8) hooks. - Clear utmpx struct before writing it to wtmpx files. - Fix directory stream leaks. - Use explicit_memset(3) instead of memset(3) to clear password. - Fix scope of variable. PR misc/50665. - Ensure that closing socket exists. CID 603440. - Add -f option to ftpd to stay in foreground with -D. PR bin/53221.
2019-01-27fix duplicated chunk from mergedholland
2019-01-27Merge the [pgoyette-compat] branchpgoyette
2019-01-22o don't display special files in the directory index. they aren'tmrg
served, but links to them are generated.
2019-01-18Adapt https://svnweb.freebsd.org/base?view=revision&revision=342113 toskrll
NetBSD. This brings us resolving for dynamically loaded libraries and makes tests/libexec/ld.elf_so/t_thread_local_dtor pass. With suggestions from joerg@
2019-01-18rework size_arrays():mrg
- avoid calloc, use bozomalloc - minor CSE - fix bozoprefs->size setting when increasing the size (new total was being added to the prior total.) found by clang static analyzer from rajeev_v_pillai. pass httpd to size_arrays() now. free(NULL) is legal.
2019-01-18fix a few problems pointed out by clang static analyzer, from rajeev_v_pillai:mrg
- bozostrnsep() may return with "in = NULL", so check for it. - nul terminating in bozo_escape_rfc3986() can be simpler - don't use uniinit variables in check_remap() - don't use re-used freed data in check_virtual(). this one is tricky as the original code was: free(request->hr_file); request->hr_file = bozostrdup(httpd, request, s ? s : "/"); however, bozostrdup() may reference request->hr_file.
2019-01-17- call this 20190116mrg
- adjust the directory indexing again: - don't include "index.html" in html headers - additional escaping of names - re-add top/bottom borders - adds an aquamarine table header - Zebra-stripes table rows using CSS instead of code all from "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>
2019-01-17add 'check' target to toplevel makefile.mrg
fix the t11.out output now that CGI parsing works better.
2019-01-17- fix CGI '+' param and error handling.mrg
- remove unused parameter to daemon_poll_err(). both from "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>
2019-01-12print the program name when we don't find a library.christos
XXX: really most _rtld_error() should do that, and most do.
2019-01-09Spell "occurrence" correctly.uwe
2019-01-08remove reference to deleted -r option. fixes PR#53840 from J. Lewis Muir.mrg
2019-01-06When loading a non-PIE main binary, the virtual address must match.joerg
Use MAP_TRYFIXED and verify that the result matches the expectation.
2019-01-04MAP_ALIGNED has existed for years, just assume it exists.joerg
2018-12-30Add support for DT_RUNPATH - it is just the same as we always have treatedmartin
DT_RPATH. Approved by core.