mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Ulrich Drepper <drepper@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] Introduce O_CLOEXEC (take >2)
Date: Thu, 31 May 2007 12:17:52 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705311205520.30485@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <20070531190235.GY4033@devserv.devel.redhat.com>

On Thu, 31 May 2007, Jakub Jelinek wrote:

> On Thu, May 31, 2007 at 11:46:31AM -0700, Davide Libenzi wrote:
> > On Thu, 31 May 2007, Ulrich Drepper wrote:
> > > Davide Libenzi wrote:
> > > > Isn't this better be a global process flag? Default should be, for legacy
> > > > reasons,
> > > 
> > > No.  Policies are always wrong since it means code that cannot change
> > > the policy (e.g, all runtime libraries) have no access to the
> > > functionality.  I cannot set the policy to default to close-on-exit in
> > > glibc all the while the application assumes this is not the case.
> > 
> > I was talking for a broader usage, not only glibc centric. Most ppl 
> > writing MT+exec apps wants all but (eventually) and handfull of files 
> > leaking across the exec boundary.
> 
> If open (and all other syscalls that create fds) have O_CLOEXEC (and
> something similar for other syscalls), then such a policy can be easily
> implemented on the userland, if desired.

That, unless you change all the syscalls creating files to accept new 
parameters, would require a syscall+fcntl operation. That is not atomic 
(ie, another thread might do exec between the syscall and the fcntl). 
Again, mine was a general comment, not directed into magically fixing 
existing buggy code. What I meant, was that the vast majority of MT+exec 
apps wants all their fds (but an handfull, maybe) to be O_CLOEXEC. So a 
global, non-inheritable, per-process flag seemed the most straightforward 
solution.



- Davide



  reply	other threads:[~2007-05-31 19:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 18:09 Ulrich Drepper
2007-05-31 18:22 ` Nicholas Miell
2007-05-31 18:32   ` Ulrich Drepper
2007-05-31 18:35 ` Davide Libenzi
2007-05-31 18:42   ` Ulrich Drepper
2007-05-31 18:46     ` Davide Libenzi
2007-05-31 18:53       ` Ulrich Drepper
2007-05-31 19:02       ` Jakub Jelinek
2007-05-31 19:17         ` Davide Libenzi [this message]
2007-05-31 19:50           ` Ulrich Drepper
2007-05-31 20:23             ` Davide Libenzi
2007-05-31 19:59           ` Linus Torvalds
2007-05-31 23:20 ` Andrew Morton
2007-06-01  1:05   ` Stephen Rothwell
2007-06-01  1:38   ` Stephen Rothwell
2007-06-01  3:07     ` Kyle McMartin
2007-06-01 19:17       ` Byron Stanoszek
2007-06-01 22:55         ` Kyle McMartin
2007-06-10  2:29 ` dean gaudet

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=Pine.LNX.4.64.0705311205520.30485@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®