All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Kevin Easton <kevin-RFfraI6bZkdAfugRpC6u6w@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] clone.2, execve.2: Document interaction of execve(2) with CLONE_FILES
Date: Thu, 05 Feb 2015 13:40:22 +0100	[thread overview]
Message-ID: <54D364B6.1050708@gmail.com> (raw)
In-Reply-To: <20130506061441.GA9249-Qr0l8DEfScZEV+tojptmR0B+6BGkLq7r@public.gmane.org>

On 05/06/2013 08:14 AM, Kevin Easton wrote:
> Hi Michael,
> 
> This patch is against man-pages-3.51.  It documents the fact that a
> successful execve(2) in a process that is sharing a file descriptor table
> results in unsharing the table.
> 
> I discovered this through testing and verified it by source inspection - 
> there is a call to unshare_files() early in do_execve_common().

Thanks, Kevin. Applied.

Cheers,

Michael


> diff -ur man-pages-3.51.orig/man2/clone.2 man-pages-3.51/man2/clone.2
> --- man-pages-3.51.orig/man2/clone.2    2013-04-19 21:57:19.000000000 +1000
> +++ man-pages-3.51/man2/clone.2 2013-05-06 15:42:06.841539649 +1000
> @@ -206,6 +206,9 @@
>  .BR fcntl (2)
>  .B F_SETFD
>  operation), the other process is also affected.
> +If a process sharing a file descriptor table calls
> +.BR execve (2),
> +its file descriptor table is duplicated (unshared).
> 
>  If
>  .B CLONE_FILES
> Only in man-pages-3.51/man2: clone.2.orig
> diff -ur man-pages-3.51.orig/man2/execve.2 man-pages-3.51/man2/execve.2
> --- man-pages-3.51.orig/man2/execve.2   2013-04-19 21:57:19.000000000 +1000
> +++ man-pages-3.51/man2/execve.2        2013-05-06 15:42:06.841539649 +1000
> @@ -204,6 +204,11 @@
>  .B SIGCHLD
>  (see
>  .BR clone (2)).
> +.IP *
> +The file descriptor table is unshared, undoing the effect of the
> +.B CLONE_FILES
> +flag of
> +.BR clone (2).
>  .PP
>  Note the following further points:
>  .IP * 3
> 
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-02-05 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06  6:14 [PATCH] clone.2, execve.2: Document interaction of execve(2) with CLONE_FILES Kevin Easton
     [not found] ` <20130506061441.GA9249-Qr0l8DEfScZEV+tojptmR0B+6BGkLq7r@public.gmane.org>
2015-02-05 12:40   ` Michael Kerrisk (man-pages) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D364B6.1050708@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=kevin-RFfraI6bZkdAfugRpC6u6w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.