Commit Graph

15665 Commits

Author SHA1 Message Date
kib
7fe8fbec77 Fix known issues which blow up the process after dlopen("libthr.so")
(or loading a dso linked to libthr.so into process which was not
linked against threading library).

MFC r276630:
Remove interposing, fix malloc, reinstall signal handlers wrappers on
libthr load.

MFC r276681:
Avoid calling internal libc function through PLT or accessing data
though GOT.

MFC r277032:
Reduce the size of the interposing table and amount of
cancellation-handling code in the libthr.

MFC note:
r276646 ("do not erronously export 'openat' symbol from rtld") is not
applicable to stable/10 yet, since PATHFDS support was not merged.
2015-01-18 11:54:20 +00:00
dim
f4d39872ad MFC r277147:
Since the merge of file 5.21 in r276415 and r276416, stable/9 and
stable/10 cannot be built from FreeBSD 8.x.  This is because the
build-tools stage requires libmagic, but lib/libmagic/config.h was
generated on head, and it now enables using the xlocale.h APIs, which
are not supported on 8.x (and on 9.x before __FreeBSD_version 900506).

See also the start of this thread on -stable:
https://lists.freebsd.org/pipermail/freebsd-stable/2015-January/081521.html

To fix this, conditionalize the use of xlocale.h APIs to make
bootstrapping from older FreeBSD versions work correctly.

Reviewed by:	delphij
Differential Revision: https://reviews.freebsd.org/D1518
2015-01-17 11:41:04 +00:00
nwhitehorn
612ef79eb0 MFC r276412:
Fix loader's ability to read the 10.1 release PowerPC ISOs. There appears to
be some kind of problem with the version of makefs used for these disks.
There may be a better way to handle this problem, so I've set the MFC
timer for a fairly long time period.
2015-01-14 21:23:46 +00:00
trasz
b93020e9d5 MFC r275752:
Fix quick_exit(3) manual page to match reality - the status was missing.

Sponsored by:	The FreeBSD Foundation
2015-01-14 11:31:31 +00:00
des
0d480bf6b4 MFH (r273114, r273124): disable SSLv3 by default. 2015-01-12 10:02:23 +00:00
ngie
0a1f910d39 MFC discussed with: jilles, -developers
MFC r266971:

  - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).
  Update the manpage to reflect this change.
  - Always set the current position to the first null-byte when opening in append
  mode. This makes the implementation compatible with glibc's. Update the test
  suite.

  Reported by:	pho
  Approved by:	cognet
2015-01-11 19:15:28 +00:00
kib
375caa6c5f MFC r276627:
Add rtld private interface for dso to detect dynamic loading
vs. static linking.
2015-01-10 09:22:17 +00:00
trasz
11ccf0efe9 MFC r274722:
Remove acl_size.c; apparently it was never used.

PR:		194398
Submitted by:	ngie@
Sponsored by:	The FreeBSD Foundation
2015-01-07 18:38:04 +00:00
kib
5777edec4a Merge reaper facility.
MFC r270443 (by mjg):
Properly reparent traced processes when the tracer dies.

MFC r273452 (by mjg):
Plug unnecessary PRS_NEW check in kern_procctl.

MFC 275800:
Add a facility for non-init process to declare itself the reaper of
the orphaned descendants.

MFC r275821:
Add missed break.

MFC r275846 (by mckusick):
Add some additional clarification and fix a few gammer nits.

MFC r275847 (by bdrewery):
Bump Dd for r275846.
2015-01-05 03:27:09 +00:00
ngie
6e9fd215c7 MFC r276320:
Parallelize building lib/ncurses

  Differential Revision: https://reviews.freebsd.org/D1353
2015-01-05 00:15:27 +00:00
ngie
fb7e4816db MFC r274618,r276521:
MFC Note: text corrected for r274618

r274618:

  Add reachover Makefiles for contrib/netbsd-tests/lib/msun

  A variant of this code has been tested on amd64/i386 for some time by
  EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
  code will remain off until it's proven it works on virtual hardware or real
  hardware on other architectures

  Sponsored by: EMC / Isilon Storage Division

r276521:

  Reset errno in :scalbnf_val and :scalbnl_val before running the tests so the
  tested errno isn't stale

  This was needed in order for the test to pass on amd64 with stable/10
2015-01-05 00:02:11 +00:00
delphij
b1a2801755 MFC r275930:
Plug a memory leak.

Obtained from:	DragonFlyBSD (commit 5119ece)
2015-01-02 18:31:12 +00:00
ngie
366f16dd6a MFC r274578,r274580:
r274578:

  Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as
  lib/libthr/tests

  A variant of this code has been tested on amd64/i386 for some time by
  EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
  code will remain off until it's proven it works on virtual hardware or real
  hardware on other architectures

  Original work by: pho
  Sponsored by: EMC / Isilon Storage Division

r274580:

  Add reachover Makefiles for contrib/netbsd-tests/lib/librt

  A variant of this code has been tested on amd64/i386 for some time by
  EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
  code will remain off until it's proven it works on virtual hardware or real
  hardware on other architectures

  Sponsored by: EMC / Isilon Storage Division
2015-01-01 02:12:43 +00:00
ngie
d4c625976a MFC r264400,r265836:
r264400:

  NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
  and finish the job. ncurses is now the only Makefile in the tree that
  uses it since it wasn't a simple mechanical change, and will be
  addressed in a future commit.

r265836:

  Remove last two NO_MAN= in the tree. In both of these cases, MAN= is
  what is needed.
2014-12-31 23:25:37 +00:00
delphij
48f640fb39 MFC r275698: MFV r275696: file 5.21. 2014-12-30 19:39:31 +00:00
ngie
2e865a9c0a MFC r273482,r274078:
r273482:

  The NetBSD libc tests use several definitions/macros that aren't available in
  FreeBSD

  Add the missing compat definitions/macros to lib/libnetbsd so the testcases
  can be compiled with libnetbsd without having to invent ad hoc #define's, or
  having to convert things over to FreeBSD idioms

  Reviewed by: brooks
  Phabric: D993
  Sponsored by: EMC / Isilon Storage Division

r274078:

  Commit missing header for sys/time.h compat on NetBSD to unbreak the amd64/i386
  build

  Pointyhat to: me (forgot to svn add it sooner)
2014-12-21 11:11:17 +00:00
ngie
dc3ad5131f MFC r273929:
r273929 (by jmmv):

  MFV: Import atf-0.21.
2014-12-21 08:30:18 +00:00
dchagin
dfe2ad4d46 MFC r274462: Add the ppoll() system call. 2014-12-21 07:58:28 +00:00
kib
55c41429c0 MFC r271315 (by joel):
Minor mdoc nit.

MFC r275806:
Markup fixes for kqueue(2), no content changes.
2014-12-18 11:36:14 +00:00
kib
9f63b4b4d8 MFC r268843 (by bapt):
Extend kqueue's EVFILT_TIMER by adding precision unit flags support.
2014-12-18 11:30:51 +00:00
jhb
adf7828a9b MFC 271635,271722:
- Only the manpage updates from 271635 are merged to give additional
  heads up for the stricter checks in 11, but the kernel in 10 remains
  permissive.
  - Fail with EINVAL if an invalid protection mask is passed to mmap().
  - Fail with EINVAL if an unknown flag is passed to mmap().
  - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
    mmap().
  - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
    mappings.
- Remove mention of MAP_INHERIT.  It hasn't been implemented for thirteen
  years.
- Remove mention of unimplemented MAP_SWAP.  There are no future plans to
  implement it.
2014-12-16 20:05:10 +00:00
andrew
90fc0dee7a Clean up our ARM assembly:
MFC 275256:

Switch to the ARM unified assembly language as the clang integrated as only
supports it. Binutils supports it when the ".syntax unified" directive
is set.

Sponsored by:   ABT Systems Ltd

MFC 275264:

Update _ENTRY to use _EENTRY to reduce the common code.

MFC 275321:

Remove extra labels, ENTRY_NP already provides them.

Sponsored by:   ABT Systems Ltd

MFC 275322:

Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND

Sponsored by:   ABT Systems Ltd

MFC 275416:

Fix the name of the coprocessor to include the "p" prefix, the clang
integrated assembler expects this.

Sponsored by:   ABT Systems Ltd

MFC 275418:

Switch to unified syntax so these can be built with clang 3.5.

Sponsored by:   ABT Systems Ltd

MFC 275519:

Add missing END macros to some of the xscale functions.

Sponsored by:   ABT Systems Ltd

MFC 275520:

Use the unified syntax in a few more assembly files

Sponsored by:   ABT Systems Ltd

MFC 275521:

Set the alignment to 4-bytes after a string as clang 3.5 can switch to
thumb mode if this is incorrect.

Sponsored by:   ABT Systems Ltd

MFC 275522:

Place the literal pool after a RET otherwise clang 3.5 tries to put it too
far away from a ldr psuedo instruction. With this clang will place the
literal value here where it's close enough to be loaded.

Sponsored by:   ABT Systems Ltd

MFC 275523:

Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is
unsupported as it needs a newer cpu.

Sponsored by:   ABT Systems Ltd

MFC 275524:

Switch to a .cpu directive. These will work when clang 3.5 is imported
where the .arch directive is a nop.

Sponsored by:   ABT Systems Ltd
2014-12-14 16:28:53 +00:00
delphij
25ca306958 MFC r275665:
Fix buffer overflow in stdio.

Security:	FreeBSD-SA-14:27.stdio
Security:	CVE-2014-8611
2014-12-10 08:24:02 +00:00
delphij
04dbe28cc6 MFC r275071:
Reinstitate send() after syslogd restarts.

In r228193 the test of CONNPRIV have been moved to before the _usleep
and send in vsyslog().  When syslogd restarts, this would prevent the
message being logged after the disconnect/connect dance for
scenario #1.

PR:		194751
Submitted by:	Peter Creath <pjcreath+freebsd gmail com>
Reviewed By:	glebius
2014-12-09 00:47:02 +00:00
brooks
0ba04a3a67 MFC r263928:
Use the correct variable name in the example code.

PR:		195749
2014-12-06 17:50:37 +00:00
trasz
f9abf723a8 MFC r273854:
Update acl(3) to expand on NFSv4 ACL support.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:51:48 +00:00
trasz
684c853eed MFC r273853:
Make it clear that ACL flags are NFSv4-only.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:50:13 +00:00
dteske
7230e71362 MFC r274116:
Add new libraries/utilities for data throughput visualization.
dpv(3): dialog progress view library
dpv(1): stream data from stdin or multiple paths with dialog progress view
figpar(3): configuration file parsing library

MFC r274120, r274121, r274123, r274124, r274144, r274146, r274159, r274192,
r274203, r274209, r274226, r274270, and r274851: Fixes following r274116

Reviews:        D714
Relnotes:       New libdpv/libfigpar and dpv(1) utility
Reviewed by:    jelischer, shurd
Discussed at:   MeetBSD California 2014 Vendor/Dev Summit
Discussed on:   -current
Thanks to:      ngie, ian, jelischer, shurd, bapt
2014-11-25 13:47:53 +00:00
kevlo
110eb67327 MFC r273760:
Fix prototypes.
2014-11-24 01:56:33 +00:00
emaste
b81b7af08d Always return pathname in dl_iterate_phdr's dlpi_name, as Linux does
Linux LD_ITERATE_PHDR(3):
    The dlpi_name field is a null-terminated string giving the
    pathname from which the shared object was loaded.

That functionality is much more useful than returning just the short
name.

Update dl_iterate_phdr(3) to follow r272842

MFC of r272842 and r272848
2014-11-14 21:52:31 +00:00
bapt
5daa84302c MFC: 272445,272578,273772,273779,273782,273786,273787,273791
Add a test for bug 191427 where pw(8) will go into an infinite loop
Add some tests for modifying groups
When a group is renamed then the group has been invalidated for sure.
In that case get the group information using the new name.

Fix a regression in pw usermod -G list

The user was perperly adding the to different groups from "list" but was not
removed from the other groups it could have belong to.

Do not delete the group wheel when bad argument is passed to pw groupdel -g

Check that the -g argument is actually a number, if not report an error.
This argument is converted without checking with atoi(3) later so without this
check it converts any alpha entries into 0 meaning it deletes the group wheel

Ensure pw userdel -u <invalid> do not try to remove root

Check the uid passed is actually a number as early as possible

Fix renaming a group via the gr_copy function

Add a regression test to pw(8) because the bug was discovered via using:
pw groupmod

PR:		193704 [1], 185666 [2], 90114 [3], 187189 [4]
Submitted by:	Marc de la Gueronniere [4]
Reported by:	az [1], sub.mesa@gmail.com [2], bkoenig@cs.tu-berlin.de [3],
		mcdouga9@egr.msu.edu [4]
2014-11-04 07:50:48 +00:00
dim
d8d62b896b MFC r273837:
Fix a clang 3.5 warning about abs(3) being given an argument of type
quad_t in setusercontext().  While here, sanitize the clamping of the
priority value, and use the correct type for the return value of
login_getcapnum().

Reviewed by:	kib
2014-11-01 13:45:01 +00:00
andrew
ce556e3257 MFC r273284:
Allow libkvm to get the kernel va to pa delta without the need for
 physaddr. This should allow for a kernel where PHYSADDR and KERNPHYSADDR
 are both undefined.

 For now libkvm will use the old method of reading physaddr and kernaddr
 to allow it to work with old kernels. This could be removed in the future
 when enough time has passed.
2014-10-29 16:36:08 +00:00
andrew
f0629d0f08 MFC r269956:
From https://sourceware.org/ml/newlib/2014/msg00113.html
 By Richard Earnshaw at ARM
 >
 >GCC has for a number of years provides a set of pre-defined macros for
 >use with determining the ISA and features of the target during
 >pre-processing.  However, the design was always somewhat cumbersome in
 >that each new architecture revision created a new define and then
 >removed the previous one.  This meant that it was necessary to keep
 >updating the support code simply to recognise a new architecture being
 >added.
 >
 >The ACLE specification (ARM C Language Extentions)
 >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html)
 >provides a much more suitable interface and GCC has supported this
 >since gcc-4.8.
 >
 >This patch makes use of the ACLE pre-defines to map to the internal
 >feature definitions.  To support older versions of GCC a compatibility
 >header is provided that maps the traditional pre-defines onto the new
 >ACLE ones.

 Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the
 couple of places in tree. clang already implements ACLE. Add a define
 that says we implement version 1.1, even though the implementation
 isn't quite complete.
2014-10-29 16:24:02 +00:00
ian
1edaa04098 MFC r266878, r266879: Add support for snprintf() to libstand. 2014-10-26 02:51:56 +00:00
andrew
58b9da93f0 MFC r273088:
Add support for the __aeabi_c*cmp* functions. These are similar to the
existing functions with the exception they use the condition flags to
store the result.
2014-10-22 13:50:38 +00:00
delphij
e5880e7052 MFC r272884:
accept(2) may and can return EAGAIN, document it.
2014-10-20 18:53:54 +00:00
ache
537ec842e6 MFC r272562,r272678,r272679
1) Fix the case we have less arguments for format string than we expected.
2) Return error on unsupported format specs.
(both according to POSIX)
3) For %Z format, understand "UTC" name too.

PR:     93197
2014-10-19 21:16:24 +00:00
antoine
3da91303cf Restore ABI compatibility with 10.0-RELEASE, so that stable/10 users can use
official freebsd packages
2014-10-19 12:11:25 +00:00
jhb
44cc4e9f20 MFC 271721:
Explicitly specify MAP_SHARED when mapping the stats file descriptor.
2014-10-15 19:27:14 +00:00
kib
c4d948e445 MFC r272070:
Expand the libthr(3) manpage to document knobs accepted by libthr.so
and explain some internal working of the library, neccessary to
understand the knobs effects.

MFC r272153 (by pluknet):
Fix description of mutex acquisition.
2014-10-15 13:39:00 +00:00
kib
6dfd0e1c93 MFC r272069:
Switch the defaults to not split the RLIMIT_STACK-sized initial thread
stack into the stacks of the created threads.  Add knob
LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour.
2014-10-15 13:36:01 +00:00
des
046882fc4f MFH (r272830): change the hardcoded default back to DES
MFH (r272833): remove last vestige of MD5 password hashes
2014-10-13 15:56:47 +00:00
hrs
a86738247c MFC r258580:
Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
  with the explicit permission of Sun Microsystems in 2009.

MFC r258581, 258582:
  Replace Sun Industry Standards Source License for Sun RPC code with a
  3-clause BSD license as specified by Oracle America, Inc. in 2010.
  This license change was approved by Wim Coekaerts, Senior Vice
  President, Linux and Virtualization at Oracle Corporation.

MFC r259117, 259118:
  Replace Sun RPC license with a 3-clause BSD license.  This license change
  was approved in 2010 by Wim Coekaerts, Senior Vice President, Linux and
  Virtualization at Oracle Corporation.

MFC r259417:
  Replace Sun RPC license for TI-RPC library with a 3-clause BSD license,
  with the explicit permission of Sun Microsystems in 2009.
  The code in question in this file was copied from lib/libc/rpc/pmap_getport.c.
2014-10-09 23:05:32 +00:00
pfg
db3266a5c5 MFC r272273, r272387, r272443, r272533 :
Add strptime(3) support for %U and %W

Add support for the missing POSIX-2001 %U and %W features: the
existing FreeBSD strptime code recognizes both directives and
validates that the week number lies in the permitted range,
but then simply discards the value.

Initial support for the feature was written by Paul Green.
David Carlier added the initial handling of tm_wday/tm_yday.
Major credit goes to Andrey Chernov for detecting much of the
brokenness and rewriting/cleaning most of the code, making it
much more robust.

Tested independently with the strptime test from the GNU C
library.

PR:		137307
Relnotes:	yes

MFC r272441 :

strptime: %s format fix.

Almost never needed in real life because %s is tends to be
only one format spec.
1) Return code of gmtime_r() is checked.
2) All flags are set.

Submitted by:	ache
2014-10-08 16:29:46 +00:00
des
6dff660c17 MFH (r272280, r272281, r272348): allow use with null user and rhost
PR:		83099 193927
Approved by:	re (kib)
2014-10-01 10:26:43 +00:00
des
dcca53b69e MFH (r271624): Upgrade to OpenPAM Ourouparia.
Approved by:	re (gjb)
2014-09-22 08:29:48 +00:00
tijl
680c2860fd MFC r257770 r257818 r257823 r260066 r260067 r260089 r260145 r268587 r268588
r268589 r268590 r268593 r268597 r269758 r270845 r270847 r270893 r270932
    r270947 r271147

Merge libm work by kargl, bde and das from the past few months.
Besides optimisations and small bug fixes this includes new implementations
for C99 functions expl, coshl, sinhl, tanhl, erfl and erfcl.

Approved by:	re (kib)
2014-09-18 15:10:22 +00:00
des
2bc2377c66 MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset.
Approved by:	re (gjb)
PR:		83099
2014-09-18 14:27:37 +00:00
ian
8a19588768 MFC r270882, r270930:
In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).
  The EABI unwind info requires a .fnend for every .fnstart, and newer
  binutils will complain about seeing two .fnstart in a row.  This change
  allows newer tools to compile our code.

  Do not generate unwind info in asm functions if _STANDALONE is defined.
  The .fnend op causes the assembler to emit RELOC references to unwind
  support functions that don't exist in libstand.

Approved by:	re(gjb)
2014-09-09 22:24:01 +00:00