Commit Graph

15419 Commits

Author SHA1 Message Date
Andreas Tobler
f9cc6b5558 Get rid of the CONCAT macro. 2013-11-23 18:50:43 +00:00
Konstantin Belousov
0a9655a082 If check_deferred_signal() execution needs binding of PLT symbol,
unlocking the rtld bind lock results in the processing of ast and
recursing into the check_deferred_signal().  Nested execution of
check_deferred_signal() delivers the signal to user code and clears
si_signo.  On return, top-level check_deferred_signal() frame
continues delivering the same signal one more time, but now with zero
si_signo.

Fix this by adding a flag to indicate that deferred delivery is
running, so check_deferred_signal() should avoid doing anything. Since
user signal handler is allowed to modify the passed machine context to
make return from the signal handler to cause arbitrary jump, or do
longjmp(). For this case, also clear the flag in thr_sighandler(),
since kernel signal delivery means that nested delivery code should
not run right now.

Reported by:	Vitaly Magerya <vmagerya@gmail.com>
Reviewed by:	davidxu, jilles
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-11-23 15:48:17 +00:00
Neel Natu
ac7304a758 Add an ioctl to assert and deassert an ioapic pin atomically. This will be used
to inject edge triggered legacy interrupts into the guest.

Start using the new API in device models that use edge triggered interrupts:
viz. the 8254 timer and the LPC/uart device emulation.

Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
2013-11-23 03:56:03 +00:00
Andreas Tobler
646c5b4840 Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and
get rid of the __CONCAT and CNAME macros.

Reviewed by:	bde, kib
2013-11-21 22:31:18 +00:00
Andreas Tobler
d2ef321a59 Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
CONCAT macros in SYS.h.

Reviewed by:	bde, kib
2013-11-21 21:25:58 +00:00
Sergey Kandaurov
481da845ce Catch up with OpenPAM Nummularia.
This fixes libpam for build32 target to dlopen() pam libraries in /usr/lib32.

Reviewed by:	des (a while ago)
MFC after:	1 week
2013-11-21 20:43:43 +00:00
Bryan Drewery
5313966ea6 Fix build with GCC
SSL_set_tlsext_host_name(3) internally does not modify the host buffer
pased to it. So it is safe to DECONST the struct url* here.

Reported by:	gjb
Approved by:	bapt (implicit)
MFC after:	1 week
X-MFC-With:	r258347
2013-11-19 16:11:03 +00:00
Bryan Drewery
4cb272a079 Support SNI in libfetch
SNI is Server Name Indentification which is a protocol for TLS that
indicates the host that is being connected to at the start of the
handshake. It allows to use Virtual Hosts on HTTPS.

Submitted by:	sbz
Submitted by:	Michael Gmelin <freebsd@grem.de> [1]
PR:		kern/183583 [1]
Reviewed by:	des
Approved by:	bapt
MFC after:	1 week
2013-11-19 15:35:26 +00:00
Tijl Coosemans
204957ef5e Bug fixes in iconv(3) UTF-7 support.
- Add ' to the list of directly encoded characters and * to the list of
  optionally directly encoded characters as per RFC 2152.

- In _citrus_UTF7_mbtoutf16 on end of input when the next output character
  has only been partially decoded, save a copy of the buffer of input
  characters (not just its length).  On the next call with more input
  characters this buffer is reprocessed together with the new input to
  form a fully decoded output character.

- At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT)
  by decrementing psenc->chlen and i.  This is needed to make room in
  psenc->ch (input buffer) in case the next input character starts a new
  base64 encoded sequence.  And also, if this is the end of input and no
  output character can be returned, this brings the encoder in the initial
  state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which
  is used by the caller to distinguish between no output and partial
  output.

- In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer)
  directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0).  This way s
  is updated correctly in case of errors.

- In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set
  (previous call did not have enough input), retrieve the previously
  decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of
  (psenc->cache >> 2).

MFC after:	5 days
2013-11-18 18:14:23 +00:00
Julio Merino
a18eacbefd MFV: Import atf-0.18.
Approved by:	rpaulo (mentor)
2013-11-17 23:51:19 +00:00
Julio Merino
615dc002b8 Fix the build of some ATF tests.
When building various programs from a single Makefile, program-specific
variables are of the form <VAR>.<PROG>, not <VAR>_<PROG>.  Fix this
obvious typo to fix the build when WITH_TESTS=yes.

I am not sure how this ever worked before given that manual inspection
of bsd.progs.mk clearly shows that the expected character between the
two components is a dot and not an underscore... but I suspect the
changes in r258095 exposed this oddity.

Approved by:	rpaulo (mentor)
2013-11-17 23:12:55 +00:00
Peter Wemm
091b8336ae Attempt to move the POSIX iconv* symbols out of runtime linker space.
FreeBSD systems usually implemented this as a third party module and
our implementation hasn't played as nicely with the old way as it could
have.

To that end:
* Rename the iconv* symbols in libc.so.7 to have a __bsd_ prefix.
* Provide .symver compatability with existing 10.x+ binaries that
  referenced the iconv symbols. All existing binaries should work.
* Like on Linux/glibc systems, add a libc_nonshared.a to the ldscript
  at /usr/lib/libc.so.
* Move the "iconv*" wrapper symbols to libc_nonshared.a

This should solve the runtime ambiguity about which symbols resolve
to where.  If you compile against the iconv in libc, your runtime
dependencies will be unambiguous.

Old 9.x libraries and binaries will always resolve against their
libiconv.so.3 like they did on 9.x.  They won't resolve against libc.

Old 10.x binaries will be satisified by the .symver helpers.

This should allow ports to selectively compile against the libiconv
port if needed and it should behave without ambiguity now.

Discussed with:	 kib
2013-11-17 22:52:17 +00:00
Eitan Adler
f3ba5fc742 Add missing include files for the printf_l and scanf_l man pages.
Reported by:	swildner@dragonflybsd.org
2013-11-17 02:03:45 +00:00
Neel Natu
565bbb8698 Move the ioapic device model from userspace into vmm.ko. This is needed for
upcoming in-kernel device emulations like the HPET.

The ioctls VM_IOAPIC_ASSERT_IRQ and VM_IOAPIC_DEASSERT_IRQ are used to
manipulate the ioapic pin state.

Discussed with:	grehan@
Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
2013-11-12 22:51:03 +00:00
Pawel Jakub Dawidek
36da5199bb Bring in libnv library for managing name/value pairs. The following types
are currently supported:

- NV_TYPE_NULL - only name, no data;
- NV_TYPE_BOOL - boolean (true or false);
- NV_TYPE_NUMBER - 64bit unsigned integer;
- NV_TYPE_STRING - C string;
- NV_TYPE_NVLIST - nested nvlist;
- NV_TYPE_DESCRIPTOR - file descriptor;
- NV_TYPE_BINARY - binary data.

For detailed documentation and examples see nv(3) manual page.

Sponsored by:	The FreeBSD Foundation
2013-11-12 19:39:14 +00:00
Ed Maste
3561791104 Update LLDB to upstream r194122 snapshot
ludes minor changes relative to upstream, for compatibility with
FreeBSD's in-tree LLVM 3.3:

- Reverted LLDB r191806, restoring use of previous API.
- Reverted part of LLDB r189317, restoring previous enum names.
- Work around missing LLVM r192504, using previous registerEHFrames API
  (limited functionality).
- Removed PlatformWindows header include and init/terminate calls.

Sponsored by:	DARPA, AFRL
2013-11-12 17:25:33 +00:00
Gleb Smirnoff
ce102ac2ae Just disable recoding support in libsmb if built WITHOUT_ICONV. 2013-11-12 15:09:28 +00:00
Edward Tomasz Napierala
af2b4c05e2 Fix typo.
Sponsored by:	The FreeBSD Foundation
2013-11-12 12:23:54 +00:00
Edward Tomasz Napierala
d5767efd88 Fix description to actually make sense.
Sponsored by:	The FreeBSD Foundation
2013-11-12 12:22:52 +00:00
Edward Tomasz Napierala
ce157d5c55 Mention acl_get_brand_np(3).
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2013-11-12 10:44:41 +00:00
Eitan Adler
69b2d025a0 Indicate that expand_number is case-insensitive.
Reviewed by:	-scsi
2013-11-12 00:56:22 +00:00
Mark Johnston
fbce8e1683 Consistently add the relocation offset only when the ELF type is not
ET_EXEC. This fixes several problems with the DTrace pid provider not
being able to match probes.

Reviewed by:	rpaulo
MFC after:	2 weeks
2013-11-11 16:57:57 +00:00
Eitan Adler
54ca276665 Fix typo: site_t -> size_t
Obtained From:	DragonflyBSD (1ac92c8c857a15dc010924c5f066da404e568640)
2013-11-10 04:06:46 +00:00
Sergey Kandaurov
dc211b3d40 Fix extattr(2) MLINKS.
MFC after:	1 week
2013-11-09 00:36:09 +00:00
Dimitry Andric
1c5ce94f1d Fix typo in include guard, found by clang 3.4.
MFC after:	3 days
2013-11-08 17:23:37 +00:00
Julio Merino
fba3cde907 Build and install the atf tests.
Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-11-08 14:33:41 +00:00
Julio Merino
cc21b86f50 Install category Kyuafiles from their category directories.
Move the installation of /usr/tests/lib/Kyuafile from src/tests/lib/
to src/lib/.  This is to keep the src/tests/ hierarchy unaware of the
rest of the tree, which makes things clearer in general.  In particular:

1) Everything related to the construction of /usr/tests/lib/ is kept
   in src/lib/.  There is no need to think about different directories
   and how they relate to each other.  (The same applies for libexec,
   usr.bin, etc. but these are not yet handled.)

2) src/tests becomes the place to keep cross-functional test programs
   and nothing else, which also helps in simplifying things.

Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-11-08 14:29:06 +00:00
Julio Merino
e01d128a42 Subsume the functionality of MK_ATF into MK_TESTS.
There is no reason to keep the two knobs separate: if tests are
enabled, the ATF libraries are required; and if tests are disabled,
the ATF libraries are not necessary.  Keeping the two just serves
to complicate the build.

Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-11-08 14:24:47 +00:00
Steve Kargl
30a919dde7 Yet, another attempt to fix the libm breakage due to the
changes in s_roundl.c to use bit twiddling.

Reported by:	ian
2013-11-07 22:46:13 +00:00
Steve Kargl
0e9dcedc67 Fix bulding libm on platforms with LDBL_MANT_DIG == 53.
Reported by:	ian
2013-11-07 21:20:34 +00:00
Steve Kargl
db89cf8efb * Use "math.h" instead of <math.h>.
* Use bit twiddling.  This requires inclusion of math_private.h
  and inclusion of float.h in s_roundl.c.  Raise invalid exception.
* Use literal integer constants where possible.  Let the compiler
  do the appropriate conversion.
* In s_roundf.c, use an F suffix on float constants instead of
  promoting float to double and then converting the result back
  to float. In s_roundl.c, use an L suffix.
* In s_roundl.c, use the ENTERI and RETURNI macros.  This requires
  the inclusion of fpmath.h and on __i386__ class hardware ieeefp.h.

Reviewed by:	bde
2013-11-06 23:44:52 +00:00
Glen Barber
8c2a40e9ef Fix .Dd after r257646.
DST affects the day by one hour, but the number of days in the
week stay the same.
2013-11-05 21:47:00 +00:00
Mark Johnston
813b26945c Modify the libproc breakpoint add/remove functions to stop the target
process if it has not already been stopped, since this is required for
ptrace(2) to work.

libdtrace does not seem to stop target processes before trying to remove
their breakpoints, so we were previously failing to remove the breakpoint
on r_debug_state() in rtld. This was causing processes to die with SIGTRAP
if they called dlopen(3) after dtrace(1) had detached.

Reported by:	symbolics@gmx.com
Reviewed by:	rpaulo
MFC after:	1 month
2013-11-05 03:23:54 +00:00
Eitan Adler
fc81a90261 Use OpenBSD's revamped description of strlcpy and strlcat.
This explanation is supposed to be simpler and better.  In particular
"comparing it to the snprintf API provides lots of value, since it raises the
bar on understanding, so that programmers/auditors will a better job calling
all 3 of these functions."

Requested by:	deraadt@cvs.openbsd.org
Obtained From:	OpenBSD
Reviewed by:	cperciva
2013-11-04 19:05:31 +00:00
Pawel Jakub Dawidek
6f62d278e8 - Add manual pages for capability rights (rights(4)), cap_rights_init(3)
family of functions and cap_rights_get(3) function.
- Update remaining Capsicum-related manual pages.

Reviewed by:	bdrewery
MFC after:	3 days
2013-11-04 14:10:22 +00:00
Jilles Tjoelker
1947c8a6d1 kqueue: Change error for kqueues rlimit from EMFILE to ENOMEM and document
this error condition in the kqueue(2) manual page.

Discussed with:	kib
2013-11-03 23:06:24 +00:00
Peter Wemm
912ce912e1 Remove the WITH_LIBICONV_COMPAT hack that seems to do more harm than
good.  This caused libc to spoof the ports libiconv namespace and
provide a colliding libiconv.so.3 to fool rtld.  This should have
been removed some time ago.
2013-11-03 19:04:57 +00:00
Ed Maste
ce086c793b Fix up FreeBSD tag for files not from a vendor branch
Unexpand the tag, remove the fbsd:nokeywords property and add the
svn:keywords property.  This should eliminate the gratuituous diffs
that appear on these files in projects branches.

Sponsored by:	The FreeBSD Foundation
2013-10-31 18:44:40 +00:00
Nathan Whitehorn
169a84dd18 Add missing header.
Submitted by:	Sean Bruno
2013-10-30 15:46:50 +00:00
Nathan Whitehorn
abe8350519 printf() specifier updates to CAM to handle either 32-bit or 64-bit lun_id_t.
MFC after:	2 weeks
2013-10-30 14:13:15 +00:00
Mark Johnston
4ec6017e0b Fix an off-by-one error when checking whether a given address is within
the extent of a symbol.

Submitted by:	Prashanth Kumar <pra_udupi@yahoo.co.in>
Reviewed by:	rpaulo
MFC after:	1 week
2013-10-29 03:52:05 +00:00
Mark Johnston
fb15925c14 Revert r257248 and fix the problem in a way that doesn't violate style(9).
Suggested by:	jmg
2013-10-29 03:12:31 +00:00
Gleb Smirnoff
acfa99a6f6 Remove ng_fec(4). 2013-10-28 14:47:33 +00:00
Mark Johnston
2e14fd4313 Fix the build with gcc. 2013-10-28 12:42:27 +00:00
Mark Johnston
7a514b6277 Remove an incorrect debug printf. 2013-10-28 01:41:59 +00:00
Olivier Houchard
122990a379 Use the size of the MACHINE_ARCH string instead of sizeof(uint32_t). It can
happen sizeof(MACHINE_ARCH) is more than 4 bytes, and bad things would
happen. This should make the ctors being called again on armeb.
2013-10-27 23:48:59 +00:00
Mark Johnston
30e81f7e3b Clean up the debug printing in libproc a bit. In particular:
* Don't print any error messages to stderr unless DEBUG is defined.
* Add a DPRINTFX macro for use when errno isn't set.
* Print the error string from libelf when appropriate.
2013-10-27 20:39:10 +00:00
Andrew Turner
c9081a6c9c Update the hard-float version of the fenv functions to use the VFP unit.
Any other floating-point unit is unsupported on ARM.
2013-10-27 10:44:22 +00:00
Eitan Adler
efac066db1 Mention in login.conf.5 which fields may be infinite and how to specifify infinity.
The number of ways to indicate this confuses people.

PR:		docs/100196
Reported by:	"Dr. Markus Waldeck" <waldeck@gmx.de>
Reported by:	Jamie Landeg Jones <jamie.landeg.jones@gmail.com>
2013-10-27 04:59:18 +00:00
Eitan Adler
23f182d7fe All man pages refer to FreeBSD so there is no need to mention "In .Fx" 2013-10-27 04:49:40 +00:00