Commit Graph

13617 Commits

Author SHA1 Message Date
Dimitry Andric
152e60f2fe Fix some leftover binaries and shared libraries in the system that still
have an executable stack, due to linking in hand-assembled .S or .s
files, that have no .GNU-stack sections:

RWX --- ---  /lib/libcrypto.so.6
RWX --- ---  /lib/libmd.so.5
RWX --- ---  /lib/libz.so.6
RWX --- ---  /lib/libzpool.so.2
RWX --- ---  /usr/lib/liblzma.so.5

These were found using scanelf, from the sysutils/pax-utils port.

Reviewed by:	kib
2011-02-15 22:03:09 +00:00
Ed Schouten
ed65ee524d Don't forget to bump man page date for r218711. 2011-02-15 20:07:35 +00:00
Ed Schouten
b6c3206f30 Remove dead reference to regexp(3). Use regex(3) instead.
PR:		docs/149950
Submitted by:	arundel@
2011-02-15 20:04:13 +00:00
Rebecca Cran
dcdb209924 Document some more sysconf(3) variables.
MFC after:	1 month
2011-02-13 17:43:56 +00:00
Konstantin Belousov
49e51fb02c Replace ERROR() macro with inline function. In-tree gcc cannot tolerate
the construct like printf("%\s", NULL) resulting from macroexpand of
ERROR(u, NULL), making it impossible to use LIBUFS_DEBUGGING.

With inline function, compiler cannot detect the NULL argument to
known function and does not try to convert it into puts().

In collaboration with:	pho
2011-02-12 12:46:00 +00:00
Warner Losh
6998f84670 Revert last commit: CPUTYPE will be defined here 2011-02-11 02:34:26 +00:00
Warner Losh
64a5f83e35 Don't require CPUTYPE to be defined for ARM, but use it if it is. 2011-02-11 02:24:04 +00:00
David Schultz
b5209b6228 Fix a bug where the wrong argument was passed to SET_FLOAT_WORD().
This bug results in a type mismatch that happens to be harmless
because of the way SET_FLOAT_WORD() works.

Submitted by:	bde
2011-02-10 07:38:38 +00:00
David Schultz
5ffd745ec2 Fix a bug where the wrong argument was passed to INSERT_WORDS().
This bug results in a type mismatch that happens to be harmless
because of the way INSERT_WORDS() works.

Submitted by:	bde
2011-02-10 07:38:13 +00:00
David Schultz
e044d80d08 For small arguments, these functions use simple approximations,
e.g. cos(small) = 1, sin(small) = small.  This commit tightens
the thresholds at which the simple approximations are used.

Reviewed by:	bde
2011-02-10 07:37:50 +00:00
David Schultz
b775d18789 Fix a bogus threshold that was copied from the double precision version.
This commit should have no effect on correctness; it merely changes the
threshold at which a simpler approximation can be used.

Reviewed by:	bde
2011-02-10 07:37:29 +00:00
Warner Losh
82394a8d94 sys/rman.h now requires sys/types.h. Include it to make the API match
the man page again.

Submitted by:	Raphael Kubo da Costa
MFC after:	2 weeks
2011-02-10 04:53:09 +00:00
Jung-uk Kim
678b238c85 Introduce a non-portable function pthread_getthreadid_np(3) to retrieve
calling thread's unique integral ID, which is similar to AIX function of
the same name.  Bump __FreeBSD_version to note its introduction.

Reviewed by:	kib
2011-02-07 21:26:46 +00:00
Jilles Tjoelker
2fee45fd74 rfork_thread(3): Mark deprecated in favor of pthread_create(3). 2011-02-06 23:26:14 +00:00
Doug Barton
5143adb549 Update to BIND 9.6.3, the latest from ISC on the 9.6 branch.
All 9.6 users with DNSSEC validation enabled should upgrade to this
version, or the latest version in the 9.7 branch, prior to 2011-03-31
in order to avoid validation failures for names in .COM as described
here:

https://www.isc.org/announcement/bind-9-dnssec-validation-fails-new-ds-record

In addition the fixes for this and other bugs, there are also the
following:

  * Various fixes to kerberos support, including GSS-TSIG
  * Various fixes to avoid leaking memory, and to problems that could
    prevent a clean shutdown of named
2011-02-06 22:46:07 +00:00
Doug Barton
fccc60c828 Vendor import of BIND 9.6.3 2011-02-05 03:14:55 +00:00
Konstantin Belousov
9f2e8bdff3 Remove duplicate .note.GNU-stack section declaration.
Reported by:	arundel
2011-02-04 21:54:06 +00:00
Konstantin Belousov
adc6846785 Remove duplicate .note.GNU-stack section declaration. bcopy already
made the neccessary provisions.

Reported by:	arundel
2011-02-04 21:04:00 +00:00
Jilles Tjoelker
12dacf622b Make sys_signame upper case.
This matches the constants from <signal.h> with 'SIG' removed, which POSIX
requires kill and trap to accept and 'kill -l' to write.

'kill -l', 'trap', 'trap -l' output is now upper case.

In Turkish locales, signal names with an upper case 'I' are now accepted,
while signal names with a lower case 'i' are no longer accepted, and the
output of 'killall -l' now contains proper capital 'I' without dot instead
of a dotted capital 'I'.
2011-02-04 16:40:50 +00:00
Ulrich Spörlein
948db0b9e9 libkvm: fix logic inversion introduced with last commit
Reported by:	Brandon Gooch <jamesbrandongooch@gmail.com>
Pointy hat to:	uqs
2011-02-02 17:01:26 +00:00
Warner Losh
41ea72bd1d Whitespace nit 2011-02-01 22:50:23 +00:00
Martin Matuska
4a81e416d6 Reintroduce bugfix from r210103 and fix xz on strong-aligned architectures.
This fix was accidentially reverted with the 5.0.0 update in r215187.

PR:		bin/154310
Submitted by:	Michael Moll <kvedulv@kvedulv.de>
MFC after:	3 days
2011-02-01 10:28:05 +00:00
Jayachandran C.
7b87c35eba Fix n32 compile.
These changes are needed to fix n32 compile after the recent change of
mips n32 MACHINE_ARCH to mipsn32eb/mipsn32el.

Reviewed by:	imp, bz (earlier version)
2011-01-27 14:16:12 +00:00
Konstantin Belousov
f1410015f0 Emit .note.GNU-stack for the syscall stubs generated by libc only on
architectures that support this .note. In particular, do not unneccessary
emit the notes on ia64 and sparc64, which ABI require non-executable stacks.

Tested by:	marcel
2011-01-25 21:06:49 +00:00
Alexander Kabaev
1bc9325f8a Do not allocate buffer to hold data for zero-sized sections. 2011-01-25 19:17:50 +00:00
Konstantin Belousov
1567387db9 Document PT_FLAG_FORKED, PT_FOLLOW_FORK, pl_tdname and pl_child_pid.
MFC after:	2 weeks
2011-01-25 11:02:12 +00:00
Ulrich Spörlein
6ee6ac7fec libkvm: Unbreak build for powerpc64/powerpc
This slipped through my testing due to the recent roto-tiling of the
ARCH/TARGET parts that I need to catch up with. Mea culpa.
2011-01-24 11:06:40 +00:00
Ulrich Spörlein
de788839e2 libkvm: fix process runtime calculation on crashdumps
Fix a long standing bug, where the procs ticks where assumed to be in
us. Instead, read cpu_tick_frequency from the kernel and use the same
logic to convert runtime. This is still too optimistic in that it
assumes cpu_tick_frequency is available and fixed. Since this function
is only called on crashdumps, I think we can live with that. Testing has
shown the values to be correct for different kern.hz inside Virtualbox.

Bump WARNS. Alignment issues on some archs mean this is still at 3.

Reviewed by:	bde
2011-01-23 11:08:36 +00:00
Ulrich Spörlein
c10970dd7d libkvm code janitoring
- make WARNS=6 clean for archs w/o strict alignment requirments
- add const, ANSIfy, remove unused vars, cast types for comparison
- thanks to differing definitions of VM_MIN_ADDRESS across our archs, we
  need to trick the compiler to not complain about signedness. We could
  either fix VM_MIN_ADDRESS to always be a simple integer or make the
  check conditional on $ARCH.

Closes PRs:	kern/42386, kern/83364
Reviewed by:	bde
2011-01-23 11:08:28 +00:00
Jilles Tjoelker
198c89c306 getgroups(2): Remove mention of <sys/param.h> and refer to sysconf(3).
Because {NGROUPS_MAX} may become variable, its value should be obtained
using sysconf(3). If a #define is used anyway, it should be obtained by
including <limits.h> as that is in POSIX like getgroups(2) itself is.
<sys/param.h> is not in POSIX.

MFC after:	1 week
2011-01-21 22:15:17 +00:00
Matthew D Fleming
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
Dag-Erling Smørgrav
e8eaf30078 Fix a bug related to connection caching which could cause a crash after
a STAT command.

PR:		kern/153748 (different patch)
Submitted by:	Mark Johnston <markjdb@gmail.com>
MFC after:	2 weeks
2011-01-17 17:25:46 +00:00
Jilles Tjoelker
c3954e3936 mknod(2): The required include is <sys/stat.h>, not <unistd.h>.
This is what SUSv4 requires, and also the only thing that works if strict
standards compliance is requested or mknodat() is needed.

PR:		standards/123688
Submitted by:	gcooper
MFC after:	1 week
2011-01-16 21:59:50 +00:00
Konstantin Belousov
33e6b543c7 Mark csu on PowerPC as not requiring executable stack.
Reviewed and tested by:	nwhitehorn
2011-01-14 11:34:58 +00:00
Konstantin Belousov
8f861da99c Mark assembler sources from libc as working with non-executable stack.
Reviewed and tested by:	nwhitehorn
2011-01-14 11:33:40 +00:00
Konstantin Belousov
c42c9d5646 Mark libcompiler_rt as not needed executable stack on powerpc.
Reviewed and tested by:	nwhitehorn
2011-01-14 11:23:39 +00:00
Konstantin Belousov
ea40bc90e1 The (%esp & 0xf) == 0 should be true before the call instruction is
executed, for the properly aligned stack.

Reported and tested by:	rstone
Pointy hat to:	kib
MFC after:	3 days
2011-01-13 23:00:22 +00:00
Dimitry Andric
9ef4e3afcb Apply a workaround for a binutils issue with the .note.ABI-tag section
generated from lib/csu/common/crtbrand.c (which ultimately ends up in
executables and shared libraries, via crt1.o, gcrt1.o or Scrt1.o).

For all arches except sparc, gcc emits the section directive for the
abitag struct in crtbrand.c with a PROGBITS type.  However, newer
versions of binutils (after 2.16.90) require the section to be of NOTE
type, to guarantee that the .note.ABI-tag section correctly ends up in
the first page of the final executable.

Unfortunately, there is no clean way to tell gcc to use another section
type, so crtbrand.c (or the C files that include it) must be compiled in
multiple steps:

- Compile the .c file to a .s file.
- Edit the .s file to change the 'progbits' type to 'note', for the section
  directive that defines the .note.ABI-tag section.
- Compile the .s file to an object file.

These steps are done in the invididual Makefiles for each applicable arch.

Reviewed by:	kib
2011-01-13 20:44:31 +00:00
David Xu
65a6aaf1f3 Fix a typo.
Submitted by:	avg
2011-01-11 01:57:02 +00:00
Konstantin Belousov
fad128db86 For the process that already loaded libthr but still not initialized
threading, fall back to libc method of performing
__pthread_map_stacks_exec() job.

Reported and tested by:	Mykola Dzham <i levsha me>
2011-01-10 16:10:25 +00:00
Doug Barton
54570c503f Revert part of r217071 so that us mere mortals can clearly see
what this bit of code is intended to do. :)

Approved by:	imp
2011-01-09 23:47:11 +00:00
Konstantin Belousov
da2fcff746 Implement the __pthread_map_stacks_exec() for libthr.
Stack creation code is changed to call _rtld_get_stack_prot() to get
the stack protection right. There is a race where thread is created
during dlopen() of dso that requires executable stacks. Then,
_rtld_get_stack_prot() may return PROT_READ | PROT_WRITE, but thread
is still not linked into the thread list. In this case, the callback
misses the thread stack, and rechecks the required protection
afterward.

Reviewed by:	davidxu
2011-01-09 12:38:40 +00:00
Konstantin Belousov
5fe94652cf Implement __pthread_map_stacks_exec() callback for libc, to change the
stack protection to allow execution for single-threaded processes.
2011-01-08 17:13:43 +00:00
Konstantin Belousov
4e738f5a8d Fix some style(9) issues.
Do not use strlcpy() where simple assignment is enough.

Noted by:	bde (long time ago)
MFC after:	1 week
2011-01-08 11:04:30 +00:00
Konstantin Belousov
af5407b895 Fix struct FILE * leak on error (in disabled by default hesiod support code).
Submitted by:	henning petersen <henning.petersen t-online de>
PR:	153756
MFC after:	1 week
2011-01-08 10:56:58 +00:00
Warner Losh
cd2ae2532f Retire TARGET_ABI.
Implement MACHINE_ARCH=mips64e[lb] to build N64 images.  This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs.  I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could.  Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.
2011-01-07 20:26:33 +00:00
Konstantin Belousov
8997563c9a Add section .note.GNU-stack for assembly files used by 386 and amd64. 2011-01-07 16:13:12 +00:00
Konstantin Belousov
6c69d05232 Add section .note.GNU-stack for assembly files used by 386 and amd64. 2011-01-07 16:09:33 +00:00
Konstantin Belousov
93ab758670 Add section .note.GNU-stack for assembly files used by 386 and amd64. 2011-01-07 16:08:40 +00:00
Konstantin Belousov
88c23d858b Add section .note.GNU-stack for assembly files used by 386 and amd64. 2011-01-07 16:07:51 +00:00