Commit Graph

224 Commits

Author SHA1 Message Date
Michael Kerrisk b43a3b301e eventfd.2, execve.2, getdents.2, ioprio_set.2, mprotect.2, signalfd.2, timerfd_create.2, wait.2, backtrace.3, clock_getcpuclockid.3, end.3, fmemopen.3, fopencookie.3, frexp.3, getdate.3, getgrouplist.3, getprotoent_r.3, getservent_r.3, gnu_get_libc_version.3, inet.3, inet_pton.3, makecontext.3, malloc.3, matherr.3, offsetof.3, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, sem_wait.3, strftime.3, strtok.3, strtol.3, core.5, proc.5, cpuset.7, mq_overview.7: Global fix: Format user input in shell sessions in boldface
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-10-29 14:54:23 -05:00
Michael Kerrisk acddbaea0c Removed trailing white space at end of lines 2008-10-07 10:58:44 +02:00
Michael Kerrisk 3a9dc9ff79 execve.2: _SC_ARG_MAX is no longer necessarily constant
POSIX.1-2001 says that the values returned by sysconf()
are constant for the life of the process.
But the fact that, since Linux 2.6.23, ARG_MAX is settable
via RLIMIT_STACK means _SC_ARG_MAX is no longer constant,
since it can change at each execve().

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-10-05 05:59:32 +02:00
Michael Kerrisk f202015b45 execve.2: Linux now imposes a floor on the ARG_MAX limit
Starting with Linux 2.6.23, the ARG_MAX limit became settable via
(1/4 of) RLIMIT_STACK.  This broke ABI compatibility if RLIMIT_STACK
was set such that ARG_MAX was < 32 pages.  Document the fact that
since 2.6.25 Linux imposes a floor on ARG_MAX, so that the old limit
of 32 pages is guaranteed.

For some background on the changes to ARG_MAX in kernels 2.6.23 and
2.6.25, see:
    http://sourceware.org/bugzilla/show_bug.cgi?id=5786
    http://bugzilla.kernel.org/show_bug.cgi?id=10095
    http://thread.gmane.org/gmane.linux.kernel/646709/focus=648101,
    checked into 2.6.25 as commit a64e715fc74b1a7dcc5944f848acc38b2c4d4ee2.

Also some reordering/rewording of the discussion of ARG_MAX.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-10-05 05:57:52 +02:00
Michael Kerrisk f3504b0292 srcfix 2008-10-05 03:29:35 +02:00
Michael Kerrisk bf50110267 execve.2: updated FIXME (for argv==NULL) in source comments 2008-10-03 06:04:03 +02:00
Michael Kerrisk 6c48afffcf wfix 2008-08-07 11:08:15 +00:00
Michael Kerrisk 2fb19a1619 The floating-point environment is reset to the default
during an execve().
2008-08-07 10:54:18 +00:00
Michael Kerrisk f0c34053bc Put SEE ALSO section into alphabetical order. 2008-07-14 15:52:21 +00:00
Michael Kerrisk 80d26cefad ffix 2008-06-26 13:28:19 +00:00
Michael Kerrisk 5b8dbfd4d0 ffixes 2008-06-26 13:23:48 +00:00
Michael Kerrisk a1d5601bee Removed trailing white space at end of lines 2008-06-12 11:52:08 +00:00
Michael Kerrisk 34dcae5481 Fix text that warns against use of NULL argv and envp.
Using a NULL envp does in fact seem to be portable (works
on Solaris and FreeBSD), but the Linux semantics for a NULL
argv certainly aren't consistent with other implementations.
See http://bugzilla.kernel.org/show_bug.cgi?id=8408.
2008-06-12 10:11:21 +00:00
Michael Kerrisk 24d01c530c s/filesystem/file system/ 2008-03-19 07:26:08 +00:00
Michael Kerrisk c15e4069f6 Added FIXME. 2008-02-22 15:38:58 +00:00
Michael Kerrisk e5a7fca5cc Clarify detail of RLIMIT_STACK/4 limit for argv+environ. 2008-02-22 15:18:34 +00:00
Michael Kerrisk e415892486 ffix 2007-12-25 21:41:35 +00:00
Michael Kerrisk d061dbacc3 spfix 2007-12-22 20:50:00 +00:00
Michael Kerrisk 4a8d10ef27 Minor rewordings 2007-12-22 17:00:19 +00:00
Michael Kerrisk 088a639be3 Make the standard indent for code samples, shell session
logs, etc. to be ".in +4n".
2007-12-19 06:57:44 +00:00
Michael Kerrisk 2777b1caec Remove section numbers for page references where the
reference refers to the page itself.  (This stops man2html
producing links from a page back to itself.)
2007-11-24 10:10:39 +00:00
Michael Kerrisk 3a16ac7aed ffix 2007-11-21 18:17:59 +00:00
Michael Kerrisk 71f66746c7 ffix 2007-11-18 07:31:02 +00:00
Michael Kerrisk 0daa9e92d0 Fix redundant formatting macros 2007-09-20 16:26:31 +00:00
Michael Kerrisk c11b1abf2e Change mtk's email address 2007-09-20 06:52:22 +00:00
Michael Kerrisk d739f5f8c7 Add text describing limit on total size of argv + evnp,
and changes that occurred with 2.6.23.
Add getopt(3) to SEE ALSO list.
2007-09-10 04:31:59 +00:00
Michael Kerrisk a8d5553785 ffix 2007-07-18 20:24:30 +00:00
Michael Kerrisk 5260fe08cf Use 'glibc' consistently to refer to GNU C library. 2007-07-09 22:01:31 +00:00
Michael Kerrisk 3f624b939f grfix 2007-07-08 12:51:09 +00:00
Michael Kerrisk 682edefb1b ffix 2007-06-22 17:16:20 +00:00
Michael Kerrisk 988db66164 strip trailing white space 2007-06-21 22:55:04 +00:00
Michael Kerrisk 8bd58774dc Formatted signal names 2007-06-21 05:38:48 +00:00
Michael Kerrisk 75b94dc35c Change "e.g. " to "e.g., ", or in some cases, "for example, ".
Change "i.e. " to i.e.., ", or in some cases, "that is, ".
2007-06-08 11:56:22 +00:00
Michael Kerrisk eb1af89677 Corrected minor spelling/wording mistakes (i.e., changes
independent of fixes for American spelling).
2007-06-08 10:58:53 +00:00
Michael Kerrisk d9bfdb9c21 Convert to American spelling conventions 2007-06-08 09:56:56 +00:00
Michael Kerrisk 53a1443cce Add SEE ALSO link to new credentials.7. 2007-06-08 07:57:18 +00:00
Michael Kerrisk 677f47663e Wrap source lines at sentence breaks. 2007-06-08 03:17:37 +00:00
Michael Kerrisk d9343c5c13 Removed version number from .TH line 2007-05-30 05:36:26 +00:00
Michael Kerrisk ad7cc990f2 Change reference to path_resolution.2 to path_resolutiion.7 2007-05-26 12:41:39 +00:00
Michael Kerrisk a7e1c01a76 ffix 2007-05-21 21:25:44 +00:00
Michael Kerrisk 8c87824d61 Made .SH into .SS 2007-05-16 02:45:55 +00:00
Michael Kerrisk a44012756e Minor repairs after global edits 2007-05-12 12:53:57 +00:00
Michael Kerrisk 60a90ecdae Convert function formatting of the form "\fBname\fP()" to ".BR name ()". 2007-05-12 09:06:04 +00:00
Michael Kerrisk 0bfa087b03 Add section numbers to references to other pages 2007-05-11 23:07:02 +00:00
Michael Kerrisk b364fca092 Removed some comment text about interpreter scripts, placing
it instead in Changes file.
2007-05-01 14:34:02 +00:00
Michael Kerrisk e506533603 hyphen --> minus 2007-05-01 07:58:48 +00:00
Michael Kerrisk d6f223a7e3 Mention effect of MS_NOSUID mount(2) flag for set-user-ID programs.
Expanded description of handling of file descriptors during
execve(), adding text to note that descriptors 0, 1, and 2
may be treated specially.
2007-04-30 14:30:17 +00:00
Michael Kerrisk e6b33ad7da Added an example program.
Expanded the discussion of interpreter scripts and the
'optional-arg' argument of an interpreter script.
Added text noting that FD_CLOEXEC causes record locks to be released.
2007-04-30 12:25:52 +00:00
Michael Kerrisk 3b5804b409 spfix 2007-04-30 10:58:27 +00:00
Michael Kerrisk 456960740c Add text noting that Linux allows 'argv' and 'envp' to be
NULL, but warning that this is non-standard and non-portable,
and should be avoided in portable programs.
Bug filed (http://bugzilla.kernel.org/show_bug.cgi?id=8408)
to get this changed, but maybe that won't be done because it
is an ABI change.
2007-04-30 10:39:32 +00:00
Michael Kerrisk cd24c68794 ffix 2007-04-30 09:00:59 +00:00
Michael Kerrisk 7fd8a3c9db wfix 2007-04-30 08:55:57 +00:00
Michael Kerrisk c13182efa3 Wrapped long lines, wrapped at sentence boundaries; stripped trailing
white space.
2007-04-12 22:42:49 +00:00
Michael Kerrisk cf0a9ace57 ffix 2007-04-05 12:36:57 +00:00
Michael Kerrisk f6cfd01694 Elimitae duplicated text; grfix 2006-11-26 22:10:20 +00:00
Michael Kerrisk fe247268a9 The PR_SET_NAME setting is not preserved across an execve(). 2006-09-13 14:08:11 +00:00
Michael Kerrisk 8106981956 s/SUID/set-user-ID/
s/SGID/set-group-ID/
2006-09-06 15:23:31 +00:00
Michael Kerrisk 80a34ae3aa Added list of process attributes that are not preserved on exec(). 2006-09-04 12:27:37 +00:00
Michael Kerrisk ef0b81712f wfix/tfix 2006-09-04 08:57:04 +00:00
Michael Kerrisk a7fadb5558 Updated CONFOMRING TOs and/or standards references. 2006-08-04 12:39:17 +00:00
Michael Kerrisk 97c1eac86f Updated CONFORMING TO section 2006-08-03 13:57:17 +00:00
Michael Kerrisk 07b501d1b9 Add text noting that effective IDs are copied to
saved set-IDs during execve().
2006-07-22 17:24:17 +00:00
Michael Kerrisk aa949e2d59 environ.5 --> environ.7 2006-04-21 00:45:46 +00:00
Michael Kerrisk 9d7f3355ef Added SEE ALSO pointing to new fexecve.3. 2006-03-07 02:20:16 +00:00
Michael Kerrisk 7fdcdf23b2 ffix 2006-03-06 04:40:24 +00:00
Michael Kerrisk 4989c2f337 Improved description of E2BIG error: it relates to the sum
of the bytes in both environment and argument list.
2005-11-08 15:25:07 +00:00
Michael Kerrisk 1e32103455 Formatting fixes 2005-10-20 15:11:10 +00:00
Michael Kerrisk d3777ff056 Formatting fix 2005-10-19 13:51:36 +00:00
Michael Kerrisk 63aa9df02f Automated unformatting of parentheses using unformat_parens.sh 2005-10-19 07:07:02 +00:00
Michael Kerrisk b14d4aa5b8 Classical BSD versions are now always named x.yBSD (formerly
there was a mix of x.yBSD and BSD x.y).
2005-07-18 15:05:56 +00:00
Michael Kerrisk 880f5b4bc3 Consistent use of "set-user-ID" and "set-group-ID". 2005-07-18 14:25:42 +00:00
Michael Kerrisk 6aacaf94e5 Hi Andries,
> The question came up whether execve of a suid binary while being ptraced
> would fail or ignore the suid part. The answer today seems to be the
> latter:
> 
> E.g. (in 2.6.11) security/dummy.c:
> 
> static void dummy_bprm_apply_creds (struct linux_binprm *bprm, int 
> unsafe)
> {
>         if (bprm->e_uid != current->uid || bprm->e_gid != current->gid) {
>                 if ((unsafe & ~LSM_UNSAFE_PTRACE_CAP) &&
> !capable(CAP_SETUID)) {
>                         bprm->e_uid = current->uid;
>                         bprm->e_gid = current->gid;
>                 }
>         }
> }
> 
> and fs/exec.c:
> 
> void compute_creds(struct linux_binprm *bprm) {
>         int unsafe;
> 
>         unsafe = unsafe_exec(current);
>         security_bprm_apply_creds(bprm, unsafe);
> }
> 
> static inline int unsafe_exec(struct task_struct *p) {
>         int unsafe = 0;
>         if (p->ptrace & PT_PTRACED) {
>                 if (p->ptrace & PT_PTRACE_CAP)
>                         unsafe |= LSM_UNSAFE_PTRACE_CAP;
>                 else
>                         unsafe |= LSM_UNSAFE_PTRACE;
>         }
>         return unsafe;
> }
> 
> That is: if the process that calls execve() is being traced,
> the LSM_UNSAFE_PTRACE bit is et in unsafe and security_bprm_apply_creds()
> will make sure the suid/sgid bits are ignored.
> 
> ---
> 
> In my man page I do not read anything like that. It says
> 
>  EPERM  The process is being traced, the user is not the  superuser and
>         the file has an SUID or SGID bit set.
> and
> 
>  If  the current program is being ptraced, a SIGTRAP is sent to it after
>  a successful execve().
> 
>  If the set-uid bit is set on the program file pointed  to  by filename
>  the  effective user ID of the calling process is changed to that of the
>  owner of the program file.
> 
> So, maybe this sentence should be amended to read
> 
>  If the set-uid bit is set on the program file pointed  to  by filename
>  and the current process is not being ptraced, the  effective user ID
>  of the calling process is changed to ...

I changed your "current" to "calling" (to be consistent with the 
rest of the page), but otherwise applied as you suggest.

The revision will appear in man-pages-2.03, which I can release
any time now.  Are you avialable to do an upload tomorrow?
2005-05-31 16:07:24 +00:00
Michael Kerrisk 305a0578bf Global change of email address for MTK (now: mtk-manpages@gmx.net) 2004-11-03 14:43:40 +00:00
Michael Kerrisk fea681dafb Import of man-pages 1.70 2004-11-03 13:51:07 +00:00