summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * MFC r290177:ngie2015-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | Integrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite as lib/libc/rpc This testcase requires rpcbind be up in running; otherwise the testcases will time out and be skipped Sponsored by: EMC / Isilon Storage Division
| * MFC r290179:ngie2015-11-091-2/+1
| | | | | | | | | | | | Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning Sponsored by: EMC / Isilon Storage Division
| * MFC: r289863,r289931,r290110,r290230,r290231,r290232ache2015-11-087-23/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r290232: Microoptimize. r290231: Addition to prev. commit. In some edge cases fp->_p can be changed in _sseek(), recalculate. r290230: Don't seek to the end if write buffer is empty (in append modes). PR: 204156 r290110: Add _flags2 per jhb@ suggestion since no room left in _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. r289931: According to POSIX, a write operation shall start at the current size of the stream (if mode had 'a' as the first character). r289863: Since no room left in the _flags, reuse __SALC for O_APPEND. It helps to remove _fcntl() call from _ftello() and optimize seek position calculation in _swrite().
| * MFC 289636:jhb2015-11-061-2/+2
| | | | | | | | Switch pl_child_pid from int to pid_t.
* | Merge branch 'stable/10' into develRenato Botelho2015-11-0310-132/+257
|\ \ | |/
| * MFC r289790: dpv(3) merged to stable/10 before release/10.2.0dteske2015-11-021-1/+1
| |
| * MFC r289793: Bump date/copyright after correcting HISTORYdteske2015-11-021-2/+2
| |
| * MFC r289794: figpar(3) merged to stable/10 before release/10.2.0dteske2015-11-021-3/+3
| |
| * MFC r287453,287454,288143:delphij2015-10-291-3/+3
| | | | | | | | | | | | file 5.25. Relnotes: yes
| * Disable SSE in libthrvangyzen2015-10-262-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang emits SSE instructions on amd64 in the common path of pthread_mutex_unlock. If the thread does not otherwise use SSE, this usage incurs a context-switch of the FPU/SSE state, which reduces the performance of multiple real-world applications by a non-trivial amount (3-5% in one application). Instead of this change, I experimented with eagerly switching the FPU state at context-switch time. This did not help. Most of the cost seems to be in the read/write of memory--as kib@ stated--and not in the #NM handling. I tested on machines with and without XSAVEOPT. One counter-argument to this change is that most applications already use SIMD, and the number of applications and amount of SIMD usage are only increasing. This is absolutely true. I agree that--in general and in principle--this change is in the wrong direction. However, there are applications that do not use enough SSE to offset the extra context-switch cost. SSE does not provide a clear benefit in the current libthr code with the current compiler, but it does provide a clear loss in some cases. Therefore, disabling SSE in libthr is a non-loss for most, and a gain for some. I refrained from disabling SSE in libc--as was suggested--because I can't make the above argument for libc. It provides a wide variety of code; each case should be analyzed separately. https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html Suggestions from: dim, jmg, rpaulo Sponsored by: Dell Inc.
| * MFC r289450:ngie2015-10-261-1/+3
| | | | | | | | | | | | | | | | | | | | Set dev->fd to -1 when calling cam_close_spec_device with a valid dev->fd descriptor to avoid trashing valid file descriptors that access dev->fd at a later point in time PR: 192671 Submitted by: Scott Ferris <scott.ferris@isilon.com> Sponsored by: EMC / Isilon Storage Division
| * MFC r288309: fnmatch(): Remove exponential behaviour as in sh r229201.jilles2015-10-251-28/+49
| | | | | | | | | | | | The old code was exponential in the number of asterisks in the pattern. However, once a match has been found upto the next asterisk, the previous asterisks are no longer relevant.
| * MFC r288430: wordexp: Rewrite to make WRDE_NOCMD reliable.jilles2015-10-252-93/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shell syntax is too complicated to detect command substitution and unquoted operators reliably without implementing much of sh's parser. Therefore, have sh do this detection. While changing sh's support anyway, also read input from a pipe instead of arguments to avoid {ARG_MAX} limits and improve privacy, and output count and length using 16 instead of 8 digits. The basic concept is: execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2", "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>); The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to fail strings containing unquoted braces with code WRDE_BADCHAR. Since this is normally not a syntax error in sh, there is still a need for checking code in libc, we_check(). The new we_check() is an optimistic check that all the characters <newline> | & ; < > ( ) { } are quoted. To avoid duplicating too much sh logic, such characters are permitted when quoting characters are seen, even if the quoting characters may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad characters that get past it and are a syntax error in sh return WRDE_SYNTAX. Although many implementations of WRDE_NOCMD erroneously allow some command substitutions (and ours even documented this), there appears to be code that relies on its security (codesearch.debian.net shows quite a few uses). Passing untrusted data to wordexp() still exposes a denial of service possibility and a fairly large attack surface. This is also a MFC of r286830 to reduce conflicts. I changed the code somewhat to avoid changes from r286941; in particular, WRDE_BADVAL can still only be returned if WRDE_UNDEF was passed. Relnotes: yes Security: fixes command execution with wordexp(untrusted, WRDE_NOCMD)
| * MFC 287386,288949,288993:jhb2015-10-231-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Export current system call code and argument count for system call entry and exit events. To preserve the ABI, the new fields are moved to the end of struct thread in these branches (unlike HEAD) and explicitly copied when new threads are created. In addition, the new tests are only added in 10. r287386: Export current system call code and argument count for system call entry and exit events. procfs stop events for system call tracing report these values (argument count for system call entry and code for system call exit), but ptrace() does not provide this information. (Note that while the system call code can be determined in an ABI-specific manner during system call entry, it is not generally available during system call exit.) The values are exported via new fields at the end of struct ptrace_lwpinfo available via PT_LWPINFO. r288949: Fix various edge cases related to system call tracing. - Always set td_dbg_sc_* when P_TRACED is set on system call entry even if the debugger is not tracing system call entries. This ensures the fields are valid when reporting other stops that occur at system call boundaries such as for PT_FOLLOW_FORKS or when only tracing system call exits. - Set TDB_SCX when reporting the stop for a new child process in fork_return(). This causes the event to be reported as a system call exit. - Report a system call exit event in fork_return() for new threads in a traced process. - Copy td_dbg_sc_* to new threads instead of zeroing. This ensures that td_dbg_sc_code in particular will report the system call that created the new thread or process when it reports a system call exit event in fork_return(). - Add new ptrace tests to verify that new child processes and threads report system call exit events with a valid pl_syscall_code via PT_LWPINFO. r288993: Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.
* | Merge branch 'stable/10' into develRenato Botelho2015-10-211-7/+6
|\ \ | |/
| * MFC 288833:jgh2015-10-141-7/+6
| | | | | | | | | | | | | | | | | | PR: 203440 (based on) Submitted by: ceratv@rpi.edu Approved by: wblock@ (mentor) Differential Revision: https://reviews.freebsd.org/D3813 - address grammar
* | MFC r285417:Luiz Otavio O Souza2015-10-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | Add new include path for sha256.h This fixes the bootstrap build on FreeBSD 10. Submitted by: andrew TAG: IPSEC-HEAD Issue: #4841
* | MFC r285366:Luiz Otavio O Souza2015-10-202-397/+0
| | | | | | | | | | | | | | | | | | | | | | Complete the move that was started w/ r263218.. For some reason I didn't delete the files, so that means we need to bring the changes in r282726 to the correct files.. make tinderbox completed with this patch... TAG: IPSEC-HEAD Issue: #4841
* | MFC r285108:Luiz Otavio O Souza2015-10-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New AES modes for IPSec, user space components. Update setkey and libipsec to understand aes-gcm-16 as an encryption method. A partial commit of the work in review D2936. Submitted by: eri Reviewed by: jmg MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) TAG: IPSEC-HEAD Issue: #4841
* | MFC r282774:Luiz Otavio O Souza2015-10-208-6/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | Unbreak MIPS build following rev. 282726 Introduce further adjustments to the renaming of libmd symbols: make sure that we do not generate dangling weak aliases, as this causes build failures on MIPS. Tested by: sbruno TAG: IPSEC-HEAD Issue: #4841
* | MFC r282736:Luiz Otavio O Souza2015-10-206-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unbreak build following rev. 282726 (Makefile.inc1): add dependency of xinstall on libmd to avoid failure of parallel bootstrap. (lib/libmd/*.h): do not redefine symbols if already defined as macros (libcrypt uses the same sources internally, redefining symbols with a prefix of its own). Fixes build failures caused by previous change to libmd. Reported by: ian Pointy hat to: thomas TAG: IPSEC-HEAD Issue: #4841
* | MFC r282726:Luiz Otavio O Souza2015-10-2014-1/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure libmd symbols do not clash with libcrypto Add a prefix to all symbols in libmd to avoid incompatibilites with same-named, but not binary compatible, symbols from libcrypto. Also introduce Weak aliases to avoid the need to rebuild dependent binaries and a major version bump. PR: 199119 Differential Revision: D2216 Reviewed by: roberto, delphij MFC after: 2 weeks TAG: IPSEC-HEAD Issue: #4841
* | MFC r272673:Luiz Otavio O Souza2015-10-204-2/+42
| | | | | | | | | | | | | | | | | | | | Add explicit_bzero(3) and its kernel counterpart. Obtained from: OpenBSD MFC after: 2 weeks TAG: IPSEC-HEAD Issue: #4841
* | MFC r263218:Luiz Otavio O Souza2015-10-202-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replace the kernel's version w/ cperciva's implementation... In all my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45% faster... This is partly due to loop unrolling, so the code size does significantly increase... I do plan on committing a version that rolls up the loops again for smaller code size for embedded systems where size is more important than absolute performance (it'll save ~6k code)... The kernel implementation is now shared w/ userland's libcrypt and libmd... We drop support for sha256 from sha2.c, so now sha2.c only contains sha384 and sha512... Reviewed by: secteam@ TAG: IPSEC-HEAD Issue: #4841
* | Revert AESNI patches.Luiz Otavio O Souza2015-10-201-9/+0
| | | | | | | | | | | | | | | | | | Revert "Importing pfSense patch aesgcm.soft.1.patch" This reverts commit 46e99a8858f1c843c1774e472c11d422ca2163ae. TAG: IPSEC-HEAD Issue: #4841
* | Merge branch 'stable/10' into develRenato Botelho2015-10-131-1/+0
|\ \ | |/
| * MFC r288953:dim2015-10-091-1/+0
| | | | | | | | Stop linking libc++.so verbosely, there is no need to.
* | Merge branch 'stable/10' into develRenato Botelho2015-10-0712-24/+192
|\ \ | |/
| * Partially revert r288607, stable/10 does not use ncurses_dll.h.in like headbdrewery2015-10-031-1/+0
| | | | | | | | does, so this file should not be in CLEANFILES / .NOPATH.
| * MFC r273756,r287980:bdrewery2015-10-032-11/+7
| | | | | | | | | | | | | | r273756: only install .pc files when we are not installing 32bit compat libs... r287980: Replace beforeinstall: handling with FILES.
| * MFC r288199,r288246:bdrewery2015-10-033-1/+4
| | | | | | | | Add missing CLEANFILES.
| * MFC 286177:jhb2015-10-011-3/+3
| | | | | | | | Fix a couple of markup typos.
| * MFC 283624,283630:jhb2015-10-014-2/+174
| | | | | | | | | | | | Export a list of VM objects in the system via a sysctl. The list can be examined via 'vmstat -o'. It can be used to determine which files are using physical pages of memory and how much each is using.
| * MFC r288092:bdrewery2015-09-291-2/+0
| | | | | | | | | | Avoid adding duplicates into OBJS. bsd.lib.mk already handles adding entries to OBJS based on SRCS.
| * MFC r285428alc2015-09-271-4/+4
| | | | | | | | Correct the description of MADV_DONTNEED.
| * MFC r287541:dim2015-09-221-1/+1
| | | | | | | | | | | | | | | | In libz's inflateMark(), avoid left-shifting a negative integer, which is undefined. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D3344
* | Merge branch 'stable/10' into develRenato Botelho2015-09-221-8/+5
|\ \ | |/
| * Long overdue MFC r284377:jlh2015-09-221-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | NetBSD commit log: Use a constant array for the MIB. Newer LLVM decided that mib[] warranted stack protections, with the obvious crash after the setup was done. As a positive side effect, code size shrinks a bit. I'm not sure why this hasn't bitten us yes, but it is certainly possible and there are no real drawbacks to this change anyway. Submitted by: pfg Obtained from: NetBSD
* | Merge branch 'stable/10' into develRenato Botelho2015-09-222-20/+26
|\ \ | |/
| * MFC r287247: Plug memory leaks when running out of memory.delphij2015-09-141-1/+3
| | | | | | | | Reported by: clang scan-build
| * MFC 287349,287404:hrs2015-09-131-7/+15
| | | | | | | | | | | | | | | | | | - Print sdl->sdl_data when sdl->sdl_nlen > 0 && sdl->sdl_alen == 0 as link_ntoa(3) does. - snprintf() returns at most size-1 of the chars printed into the buffer. (n == hostlen) also means the buffer length was too short.
| * MFC 287595:hrs2015-09-131-12/+8
| | | | | | | | | | | | | | - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet() did not work as expected. - Simplify afdl table lookup.
* | Merge branch 'stable/10' into develRenato Botelho2015-09-1130-160/+156
|\ \ | |/
| * MFC r287360:kib2015-09-081-1/+1
| | | | | | | | | | Fix t_spawnattr test for attributes handling by posix_spawn(3). Connect it to the build.
| * MFC r287093:delphij2015-09-081-1/+1
| | | | | | | | | | | | | | Instead of doing an no-op (|= 0), actually clear the flags in acl_clear_flags_np. Reported by: Pascal Drecker <pascal freebsd drecker com>
| * MFC r287292:kib2015-09-0522-121/+104
| | | | | | | | | | | | | | | | | | | | Switch libc from using _sig{procmask,action,suspend} symbols, which are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. MFC r287300: Use libthr interposed functions instead of syscalls, in posix_spawn()' child.
| * MFC 283622:jhb2015-09-034-4/+8
| | | | | | | | | | Add <sys/user.h> to the SYNOPSIS of the kinfo_get*() functions since these functions all return types that are defined in that header.
| * MFC: r286490,r286491,r287125bapt2015-09-021-16/+6
| | | | | | | | | | | | | | | | | | Per rfc3629 value greater than 0x10ffff should be rejected (r286490,r286491) Make UTF-8 parsing and generation more strict. (r287125 by ed) - in mbrtowc() we need to disallow codepoints above 0x10ffff. - In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.
| * MFC r286910:delphij2015-09-011-10/+5
| | | | | | | | | | | | | | | | - ANSIfy - Remove the redundant _PATH_RSH definition (paths.h at r96194); - Use pid_t for PIDs - Note that we are at the same level of OpenBSD's counterpart of revision 1.7 (r94757).
| * MFC r279084,280713: setmode(): Use sysctl kern.proc.umask instead of umask()jilles2015-08-291-9/+33
| | | | | | | | | | | | | | | | | | if possible. The kern.proc.umask.<pid> sysctl allows querying the umask without temporarily modifying it. r280713 is the actual change, while r279084 is a whitespace change.
OpenPOWER on IntegriCloud