Commit Graph

1322 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
8ce58daf17 Move getloginclass(2) and setloginclass(2) to FBSD_1.2, where they should've
been added in the first place.
2011-03-06 08:55:36 +00:00
Edward Tomasz Napierala
e057276a4e Add FBSD_1.2; syscalls added in 9-CURRENT are supposed to go there.
Suggested by:	kib
2011-03-06 08:52:59 +00:00
Edward Tomasz Napierala
7369a541f7 Add manual page for getloginclass(2) and setloginclass(2). 2011-03-06 08:35:50 +00:00
Edward Tomasz Napierala
2bfc50bc4f Add two new system calls, setloginclass(2) and getloginclass(2). This makes
it possible for the kernel to track login class the process is assigned to,
which is required for RCTL.  This change also make setusercontext(3) call
setloginclass(2) and makes it possible to retrieve current login class using
id(1).

Reviewed by:	kib (as part of a larger patch)
2011-03-05 12:40:35 +00:00
Robert Watson
d2deca0335 Make cap_new(2) and cap_getmode(2) symbols from libc public so applications
can link against them.  Add man pages for the new system calls, with one
errant forward reference to changes not yet present in FreeBSD, but soon
will be.

Reviewed by:	anderson
Obtained from:	Capsicum Project
Sponsored by:	Google, Inc.
Discussed with:	benl, kris, pjd
MFC after:	3 months
2011-03-03 11:31:08 +00:00
Robert Watson
31cd487f40 Add description of ECAPMODE to errno(2) man page.
Discussed with: anderson
Obtained from:  Capsicum Project
Sponsored by:   Google, Inc.
MFC after:      3 months
2011-03-03 11:29:48 +00:00
Sergey Kandaurov
7ec9c8d170 Remove sysctl vm.max_proc_mmap used to protect from KVA space exhaustion.
As it was pointed out by Alan Cox, that no longer serves its purpose with
the modern UMA allocator compared to the old one used in 4.x days.

The removal of sysctl eliminates max_proc_mmap type overflow leading to
the broken mmap(2) seen with large amount of physical memory on arches
with factually unbound KVA space (such as amd64).  It was found that
slightly less than 256GB of physmem was enough to trigger the overflow.

Reviewed by:	alc, kib
Approved by:	avg (mentor)
MFC after:	2 months
2011-02-24 09:22:56 +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
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
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
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
8863c9c75e Emit .note.GNU-stack for the syscall stubs generated by libc. 2011-01-07 14:28:54 +00:00
Rebecca Cran
e04b58b0cf Sort cross references by section.
Reported by: pluknet
2010-12-18 10:09:07 +00:00
Rebecca Cran
110ac7a3e4 Update shmget(2) with POSIX access permissions and remove non-standard SHM_R,
SHM_W and machine/param.h.
2010-12-17 21:10:08 +00:00
Luigi Rizzo
5c9d0a9ad3 This commit implements the SO_USER_COOKIE socket option, which lets
you tag a socket with an uint32_t value. The cookie can then be
used by the kernel for various purposes, e.g. setting the skipto
rule or pipe number in ipfw (this is the reason SO_USER_COOKIE has
been implemented; however there is nothing ipfw-specific in its
implementation).

The ipfw-related code that uses the optopn will be committed separately.

This change adds a field to 'struct socket', but the struct is not
part of any driver or userland-visible ABI so the change should be
harmless.

See the discussion at
http://lists.freebsd.org/pipermail/freebsd-ipfw/2009-October/004001.html

Idea and code from Paul Joe, small modifications and manpage
changes by myself.

Submitted by:	Paul Joe
MFC after:	1 week
2010-11-12 13:02:26 +00:00
Jaakko Heinonen
2feecf0bfb - Note that non-superusers are not allowed to set the SF_ARCHIVED
flag. [1]
- Note that also fchflags(2) will return EPERM for attempts to set or
  unset the SF_SNAPSHOT flag.

Submitted by:	Garrett Cooper [1]
MFC after:	1 week
2010-10-29 15:03:29 +00:00
Ulrich Spörlein
2914feeb7e mdoc: make pages render with mandoc
It's a bit more pedantic regarding .Bl list elements. This has an added
benefit of unbreaking the ipfw(8) manpage, where groff was silently
skipping one list element.
2010-10-21 12:27:13 +00:00
Rui Paulo
565424b2fd Clang related fixes:
* When calling syslog(), pass a format string.
* Define YY_NO_INPUT on nslexer.l

Submitted by:	Norberto Lopes <nlopes.ml at gmail.com>
2010-10-13 16:57:06 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Alan Cox
8f7f5a7f26 Fix exec_imgact_shell()'s handling of two error cases: (1) Previously, if
the first line of a script exceeded MAXSHELLCMDLEN characters, then
exec_imgact_shell() silently truncated the line and passed on the truncated
interpreter name or argument.  Now, exec_imgact_shell() will fail and return
ENOEXEC, which is the commonly used errno among Unix variants for this type
of error. (2) Previously, exec_imgact_shell()'s check on the length of the
interpreter's name was ineffective.  In other words, exec_imgact_shell()
could not possibly fail and return ENAMETOOLONG.  The reason being that the
length of the interpreter name had to exceed MAXSHELLCMDLEN characters in
order that ENAMETOOLONG be returned.  But, the search for the end of the
interpreter name stops after at most MAXSHELLCMDLEN - 2 characters are
scanned.  (In the end, this particular error is eventually discovered
outside of exec_imgact_shell() and ENAMETOOLONG is returned.  So, the real
effect of this second change is that the error is detected earlier, in
exec_imgact_shell().)

Update the definition of MAXINTERP to the actual limit on the size of
the interpreter name that has been in effect since r142453 (from
2005).

In collaboration with: kib
2010-09-21 16:24:51 +00:00
Glen Barber
416d1e6f23 Bump dates in dbopen(3) and cpuset_getaffinity(2) from r212441 and
r212438, repectively.

Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-12 14:04:05 +00:00
Glen Barber
cbd5df1c04 Add EINVAL to list of possible return values for cpuset_getaffinity(2).
PR:		149978
Submitted by:	gcooper
Patch by:	gcooper
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-10 23:15:05 +00:00
David Xu
83c9e0893f Because POSIX does not allow EINTR to be returned from sigwait(),
add a wrapper for it in libc and rework the code in libthr, the
system call still can return EINTR, we keep this feature.

Discussed on: thread
Reviewed by:  jilles
2010-09-10 01:47:37 +00:00
Glen Barber
1bc1532c36 Add ECONNRESET to list of possible errors in connect(2).
PR:		148683
Submitted by:	Gennady Proskurin <gpr at mail dot ru>
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-06 21:39:54 +00:00
Konstantin Belousov
da881cad07 Use NULL instead of 0 for pointer in example.
MFC after:	3 days
2010-08-29 16:38:08 +00:00
Alan Cox
74ffb9af15 Add the MAP_PREFAULT_READ option to mmap(2).
Reviewed by:	jhb, kib
2010-08-28 16:57:07 +00:00
Rebecca Cran
e7f8dd75b3 Fix incorrect usage of 'assure' and 'insure'.
Approved by: rrs (mentor)
2010-08-28 16:32:01 +00:00
Warner Losh
2c0959ae6b Powerpc is special here. powerpc and powerpc64 use different ABIs, so
their implementations aren't in the same files.  Introduce LIBC_ARCH
and use that in preference to MACHINE_CPUARCH.  Tested by amd64 and
powerpc64 builds (thanks nathanw@)
2010-08-24 20:54:43 +00:00
Konstantin Belousov
3e3fbd3f25 Remove extra FreeBSD tag.
MFC after:	3 days
2010-08-24 13:02:22 +00:00
Konstantin Belousov
da2a0df59c Move the __stack_chk_fail_local@FBSD_1.0 compat symbol definition into
the separate .o for libc_pic.a. This prevents rtld from making the
symbol global.

Putting the stack_protector_compat.c into the public domain acknowledged
by kan.

Reviewed by:	kan
MFC after:	2 weeks
2010-08-24 12:58:54 +00:00
Warner Losh
25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Konstantin Belousov
2793b01844 Use aux vector to get values for SSP canary, pagesize, pagesizes array,
number of host CPUs and osreldate.

This eliminates the last sysctl(2) calls from the dynamically linked image
startup.

No objections from:	kan
Tested by:	marius (sparc64)
MFC after:	1 month
2010-08-17 09:13:26 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Joel Dahl
f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Joel Dahl
edfa427cf1 Spelling fixes. 2010-08-02 16:01:45 +00:00
Ulrich Spörlein
32ba16b6e6 Fix a couple of typos.
PR:		docs/148891
Submitted by:	olgeni
MFC after:	1 week
2010-07-30 11:58:18 +00:00
Edward Tomasz Napierala
d8561f0a50 Update mlockall(2) to mention that it's superuser-only syscall, just
like the mlock(2) manual page says.  Update mlock(2) to say that hitting
RLIMIT_MEMLOCK results in ENOMEM, not EAGAIN.

MFC after:	1 month
2010-07-27 20:34:37 +00:00
Konstantin Belousov
cefac16712 Document pl_siginfo and PT_FLAG_SI for PT_LWPINFO.
MFC after:	1 month
2010-07-10 14:31:44 +00:00
Pawel Jakub Dawidek
da6ee3126b Just like in case of setgroups(2), for getgroups(2) also advice including
sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS
definitions.
2010-06-26 21:44:05 +00:00
Ulrich Spörlein
ef8a3e5cf2 mdoc: remove literal tabs where they don't belong 2010-06-08 16:48:59 +00:00
Colin Percival
8fd6c56d29 Change the current working directory to be inside the jail created by
the jail(8) command. [10:04]

Fix a one-NUL-byte buffer overflow in libopie. [10:05]

Correctly sanity-check a buffer length in nfs mount. [10:06]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:04.jail
Security:	FreeBSD-SA-10:05.opie
Security:	FreeBSD-SA-10:06.nfsclient
2010-05-27 03:15:04 +00:00
Konstantin Belousov
0475ecd50a Improve the documentation for PT_LWPINFO. Note that some features are
not implemented on MIPS and ARM.

MFC after:	1 month
2010-05-24 17:23:14 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Christian Brueffer
0b35d6a71b Document FIONREAD, FIONWRITE and FIONSPACE.
Obtained from:	NetBSD
Submitted by:	emaste
MFC after:	1 week
2010-05-11 17:02:12 +00:00
Jilles Tjoelker
b88c83ff14 sigprocmask(2): pthread_sigmask(3) must be used in threaded processes.
Although libthr's pthread_sigmask() just calls sigprocmask() and this is
unlikely to change, mention this POSIX requirement on applications.

MFC after:	1 week
2010-05-07 20:46:22 +00:00
Kirk McKusick
e27ed89aef Merger of the quota64 project into head.
This joint work of Dag-Erling Smørgrav and myself updates the
FFS quota system to support both traditional 32-bit and new 64-bit
quotas (for those of you who want to put 2+Tb quotas on your users).

By default quotas are not compiled into the kernel. To include them
in your kernel configuration you need to specify:

options         QUOTA                   # Enable FFS quotas

If you are already running with the current 32-bit quotas, they
should continue to work just as they have in the past. If you
wish to convert to using 64-bit quotas, use `quotacheck -c 64';
if you wish to revert from 64-bit quotas back to 32-bit quotas,
use `quotacheck -c 32'.

There is a new library of functions to simplify the use of the
quota system, do `man quotafile' for details. If your application
is currently using the quotactl(2), it is highly recommended that
you convert your application to use the quotafile interface.
Note that existing binaries will continue to work.

Special thanks to John Kozubik of rsync.net for getting me
interested in pursuing 64-bit quota support and for funding
part of my development time on this project.
2010-05-07 00:41:12 +00:00
Jilles Tjoelker
c84cab5626 Update xrefs from 4.3BSD to modern signal functions in various man pages.
sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and
sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2).

Some legacy man pages still refer to them, that is OK.
2010-05-06 22:49:54 +00:00
Jilles Tjoelker
29b7bdea79 sigaltstack(2): document some modernizations:
* un-document 'struct sigaltstack' tag for stack_t as this is BSD-specific;
  this doesn't seem useful enough to document as such
* alternate stacks are per thread, not per process
* update error codes to what the kernel does and POSIX requires

MFC after:	1 week
2010-05-06 22:06:14 +00:00
Kirk McKusick
945f418ab8 Final update to current version of head in preparation for reintegration. 2010-05-06 17:37:23 +00:00
Konstantin Belousov
f742a317e6 Document RUSAGE_THREAD.
Reviewed by:	bde
MFC after:	1 week
2010-05-04 06:01:25 +00:00