| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit. Merge it:
Remove undefined behavior from sranddev() and
srandomdev(). This doesn't actually work
with any modern C compiler:
In particular, both clang and modern gcc
verisons silently elide any xor operation
with 'junk'.
No mergeinfo changes with this commit as r241475 already updated the
mergeinfo.
Approved by: re (jpaetzel)
Notes:
svn path=/releng/8.4/; revision=249031
|
| |
|
|
|
|
|
| |
Improve code style. No functional change.
Notes:
svn path=/stable/8/; revision=248020
|
| |
|
|
|
|
|
| |
Cleanup the code a bit, which improves the portability.
Notes:
svn path=/stable/8/; revision=248007
|
| |
|
|
|
|
|
| |
Fix the handling of mapped IPv6 addresses in sctp_connectx().
Notes:
svn path=/stable/8/; revision=248006
|
| |
|
|
|
|
|
| |
Fix errno in a couple of error cases.
Notes:
svn path=/stable/8/; revision=248000
|
| |
|
|
|
|
|
|
|
|
| |
Add a IP_RECVTOS socket option to receive for received UDP/IPv4
packets a cmsg of type IP_RECVTOS which contains the TOS byte.
Much like IP_RECVTTL does for TTL. This allows to implement a
protocol on top of UDP and implementing ECN.
Notes:
svn path=/stable/8/; revision=247944
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=247500
|
| |
|
|
|
|
|
|
|
| |
Change examples to be consistent with what style(9) says.
Approved by: joel (mentor)
Notes:
svn path=/stable/8/; revision=247466
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add a sample program that shows how a custom comparison function and
qsort(3) can work together to sort an array of integers.
PR: docs/176197
Submitted by: Fernando, fapesteguia at opensistemas.com
Christoph Mallon, christoph.mallon at gmx.de
Approved by: gjb (mentor), remko (mentor)
Notes:
svn path=/stable/8/; revision=247276
|
| |
|
|
|
|
|
| |
Document the ERESTART translation to EINTR for devfs nodes.
Notes:
svn path=/stable/8/; revision=247084
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Protect against DoS attacks, such as being described in CVE-2010-2632.
The changes were derived from what has been committed to NetBSD, with
modifications. These are:
1. Preserve the existsing GLOB_LIMIT behaviour by including the number
of matches to the set of parameters to limit.
2. Change some of the limits to avoid impacting normal use cases:
GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3)
can still provide a full command line of expanded names.
GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than
that 128 feels too low (it's not a limit that impacts the
behaviour of the test program listed in CVE-2010-2632).
GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can
still provide a fill command line of expanded names.
3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or
GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in
those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we
would otherwise overrun the buffer.
This change also modifies the existing behaviour of glob(3) in case
GLOB_LIMIT is specifies by limiting the *new* matches and not all
matches. This is an important distinction when GLOB_APPEND is set or
when the caller uses a non-zero gl_offs. Previously pre-existing
matches or the value of gl_offs would be counted in the number of
matches even though the man page states that glob(3) would return
GLOB_NOSPACE when gl_matchc or more matches were found.
The limits that cannot be circumvented are GLOB_LIMIT_STRING and
GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3)
again and with GLOB_APPEND set.
The entire description above applies only when GLOB_LIMIT has been
specified of course. No limits apply when this flag isn't set!
Obtained from: Juniper Networks, Inc
Notes:
svn path=/stable/8/; revision=246357
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In globextend() when the pathv vector cannot be (re-)allocated, don't
free and clear the gl_pathv pointer in the glob_t structure. Such
breaks the invariant of the glob_t structure, as stated in the comment
right in front of the globextend() function. If gl_pathv was non-NULL,
then gl_pathc was > 0. Making gl_pathv a NULL pointer without also
setting gl_pathc to 0 is wrong.
Since we otherwise don't free the memory associated with a glob_t in
error cases, it's unlikely that this change will cause a memory leak
that wasn't already there to begin with. Callers of glob(3) must
call globfree(3) irrespective of whether glob(3) returned an error
or not.
MFC r243759 (marcel):
In globextend(), take advantage of the fact that realloc(NULL, size) is
equivalent to malloc(size). This eliminates the conditional expression
used for calling either realloc() or malloc() when realloc() will do
all the time.
Notes:
svn path=/stable/8/; revision=246356
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store
path longer than this.
- Fix an unreached case of check against sizeof buf, which in turn leads
to an off-by-one nul byte write on the stack. The original condition
can never be satisfied because the passed boundary is the maximum value
that can be returned, so code was harmless.
Notes:
svn path=/stable/8/; revision=246198
|
| |
|
|
|
|
|
| |
- Use standard RETURN VALUES section.
Notes:
svn path=/stable/8/; revision=245789
|
| |
|
|
|
|
|
| |
of getipnodebyname(1) only to IPv6 address.
Notes:
svn path=/stable/8/; revision=245557
|
| |
|
|
|
|
|
| |
Add Simplified Chinese catalogs.
Notes:
svn path=/stable/8/; revision=245278
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=242773
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=242770
|
| |
|
|
|
|
|
|
|
| |
remove duplicate semicolons where possible.
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=242543
|
| |
|
|
|
|
|
|
|
|
| |
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=242297
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove undefined behavior from sranddev() and
srandomdev(). This doesn't actually work
with any modern C compiler:
In particular, both clang and modern gcc
verisons silently elide any xor operation
with 'junk'.
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=241475
|
| |
|
|
|
|
|
|
| |
When WIFCONTINUED was added, the number of "first" macros grew from
three to four.
Notes:
svn path=/stable/8/; revision=241317
|
| |
|
|
|
|
|
|
|
| |
clarify the wording for 'first' and 'last'
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=241172
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Complete revert of r239963 (from head).
The attempt to merge changes from the linux libtirpc caused
rpc.lockd to exit after startup under unclear conditions.
Reported by: David Wolfskill
Notes:
svn path=/stable/8/; revision=241060
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Revert a change from Bull's NFSv4 libtirpc implementation:
libtirpc: be sure to free cl_netid and cl_tp
This change is causing rpc.lockd to exit after startup.
Reported by: David Wolfskill
Notes:
svn path=/stable/8/; revision=240980
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bring some changes from Bull's NFSv4 libtirpc implementation.
____
Fixed infinite loop in svc_run()
____
__rpc_taddr2uaddr_af() assumes the netbuf to always have a
non-zero data. This is a bad assumption and can lead to a
seg-fault. This patch adds a check for zero length and returns
NULL when found.
____
Changed clnt_spcreateerror() to return clearer
and more concise error messages.
____
Converted all uid and gid variables of the type uid_t and gid_t.
____
libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed
These fields in the rpcbind GETADDR call are being passed uninitialized
to CLNT_CALL. In the case of x86_64 at least, this usually leads to a
segfault. On x86, it sometimes causes segfaults and other times causes
garbage to be sent on the wire.
rpcbind generally ignores the r_owner field for calls that come in over
the wire, so it really doesn't matter what we send in that slot. We just
need to send something. The reference implementation from Sun seems to
send a blank string. Have ours follow suit.
____
libtirpc: be sure to free cl_netid and cl_tp
When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.
____
Obtained from: Bull GNU/Linux NFSv4 Project
Notes:
svn path=/stable/8/; revision=240800
|
| |
|
|
|
|
|
| |
Document F_DUP2FD_CLOEXEC.
Notes:
svn path=/stable/8/; revision=239863
|
| |
|
|
|
|
|
| |
Document F_DUPFD_CLOEXEC.
Notes:
svn path=/stable/8/; revision=239862
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refine the implementation of POSIX_FADV_NOREUSE to perform
POSIX_FADV_DONTNEED requests on the currently accessed portion of the
file on each read(2) or write(2) rather than using direct I/O. This
gives much better performance including read-ahead and write clustering
similar to normal read(2) and write(2) calls.
If subsequent read(2) and write(2) calls are sequential, then the
POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed
range.
Notes:
svn path=/stable/8/; revision=239788
|
| |
|
|
|
|
|
|
| |
Since r142667 strerror has unconditionally returned a pointer to a
static buffer.
Notes:
svn path=/stable/8/; revision=239424
|
| |
|
|
|
|
|
|
| |
Executing CPUID with EAX set to 1 to actually get feature flags.
PR: 169730
Notes:
svn path=/stable/8/; revision=238541
|
| |
|
|
|
|
|
|
|
|
| |
Don't close an uninitialized descriptor.
PR: bin/167302
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=237634
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix grammar.
PR: 140457
Submitted by: jeremyhu AT apple.com
Approved by: gjb (mentor)
Notes:
svn path=/stable/8/; revision=237585
|
| |
|
|
|
|
|
|
|
| |
Make sure that fstab fd is not leaked on exec.
PR: kern/169023
Notes:
svn path=/stable/8/; revision=237362
|
| |
|
|
|
|
|
|
|
| |
Correct some bugs that resulted from arm/_fpmath.h being blindly copied
from the x86 version, which has a completely different long double
format.
Notes:
svn path=/stable/8/; revision=237024
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
232520 (partial),235563:
Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs. As a side-effect, it enables AVX on capable
CPUs.
In particular:
- Query the CPU support for XSAVE, list of the supported extensions
and the required size of FPU save area. The hw.use_xsave tunable is
provided for disabling XSAVE, and hw.xsave_mask may be used to
select the enabled extensions.
- Remove the FPU save area from PCB and dynamically allocate the
(run-time sized) user save area on the top of the kernel stack,
right above the PCB. Reorganize the thread0 PCB initialization to
postpone it after BSP is queried for save area size.
- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
well. FPU state is only useful for suspend, where it is saved in
dynamically allocated suspfpusave area.
- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
enabled.
- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
mcontext_t has a valid pointer to out-of-struct extended FPU
state. Signal handlers are supplied with stack-allocated fpu
state. The sigreturn(2) and setcontext(2) syscall honour the flag,
allowing the signal handlers to inspect and manipilate extended
state in the interrupted context.
- The getcontext(2) never returns extended state, since there is no
place in the fixed-sized mcontext_t to place variable-sized save
area. And, since mcontext_t is embedded into ucontext_t, makes it
impossible to fix in a reasonable way. Provide a sysarch(2)
facility to query extended FPU state.
- Add API for obtaining extended machine context states that cannot be
fit into existing mcontext_t.
On i386 and amd64 return the extended FPU states using
getcontextx(3). For other architectures, getcontextx(3) returns the
same information as getcontext(2).
- Add ptrace(2) support for getting and setting extended state; while
there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.
- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
consumers, making it opaque. Internally, struct fpu_kern_ctx now
contains a space for the extended state. Convert in-kernel consumers
of fpu_kern KPI both on i386 and amd64.
Reviewed by: kib
Notes:
svn path=/stable/8/; revision=237009
|
| |
|
|
|
|
|
|
|
|
| |
Only set _w to 0 when the file stream is not currently reading. Without this fflush may fail to write data in the buffer.
PR: kern/137819
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=236982
|
| |
|
|
|
|
|
| |
Clarify the SEEK_HOLE description, it repositions the file pointer.
Notes:
svn path=/stable/8/; revision=236225
|
| |
|
|
|
|
|
|
|
| |
General mdoc(7) and typo fixes.
PR: 167713
Notes:
svn path=/stable/8/; revision=235581
|
| |
|
|
|
|
|
|
|
| |
General mdoc(7) and typo fixes.
PR: 167734
Notes:
svn path=/stable/8/; revision=235576
|
| |
|
|
|
|
|
| |
Plug a leak.
Notes:
svn path=/stable/8/; revision=235468
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On shared object unload, in __cxa_finalize, call and clear all installed
atexit and __cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.
Use _rtld_addr_phdr to locate segment information from the address of
private variable belonging to the dso, supplied by crtstuff.c. Provide
utility function __elf_phdr_match_addr to do the match of address against
dso executable segment.
Call back into libthr from __cxa_finalize using weak
__pthread_cxa_finalize symbol to remove any atfork handler which
function points into unloaded object.
The rtld needs private __pthread_cxa_finalize symbol to not require
resolution of the weak undefined symbol at initialization time. This
cannot work, since rtld is relocated before sym_zero is set up.
MFC r211894:
Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info.
Requested and tested by: Peter Jeremy <peter rulingia com>
Notes:
svn path=/stable/8/; revision=235198
|
| |
|
|
|
|
|
|
|
|
|
| |
Introduce implementation-private rtld interface _rtld_addr_phdr, which
fills struct dl_phdr_info for the shared object that contains the
specified address, if any.
Requested and tested by: Peter Jeremy <peter rulingia com>
Notes:
svn path=/stable/8/; revision=235191
|
| |
|
|
|
|
|
| |
Remove debug output.
Notes:
svn path=/stable/8/; revision=235185
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Import stdbuf(1) and the shared library it relies on.
This tool changes the default buffering behaviour of standard
stdio streams.
It only works on dynamic binaries. To make it work for static
ones it would require cluttering stdio because there no single
entry point.
PR: 166660
Reviewed by: current@, jhb
Approved by: kib (mentor)
MFC after: 1 week
MFC r234773:
Fix small documentation mistakes.
Submitted by: brueffer
Approved by: kib (mentor)
MFC r234779:
Use standard getopt(3) error message.
Submitted by: jilles
Approved by: kib (mentor)
Notes:
svn path=/stable/8/; revision=235141
|
| |
|
|
|
|
|
|
|
|
| |
pread(2) might fail with EBUSY, so document it
PR: docs/167201
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=235089
|
| |
|
|
|
|
|
|
|
|
| |
Allow users of gprof to get per run output files (using the pid)
PR: bin/99800
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=235084
|
| |
|
|
|
|
|
| |
Fix several memory and lock leaks on the out of memory condition.
Notes:
svn path=/stable/8/; revision=235046
|
| |
|
|
|
|
|
|
|
|
|
| |
Return EBADF instead of EMFILE from dup2 when the second argument is
outside the range of valid file descriptors
PR: kern/164970
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=234967
|
| |
|
|
|
|
|
|
|
|
| |
Document the standardization status of err* and warn*
PR: docs/164939
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=234964
|