mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap
Date: Sun, 3 Jun 2007 13:19:39 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0706031311490.13247@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <466319DB.80800@redhat.com>

On Sun, 3 Jun 2007, Ulrich Drepper wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Davide Libenzi wrote:
> >> I agree with Ingo, no need for a second magic value.  Use the same value
> >>  as FD_UNSEQ_ALLOC which will just mean this exact value should never be
> >> used as a file descriptor.
> > 
> > I explained this in my answer to Ingo...
> 
> And if we have a new syscall we don't need any of that special dup2
> behavior you describe.  I really don't think this should be added.  dup2
> should just do what POSIX specifies, nothing more.  I would even suggest
> to not allow to dup2() to a descriptor > RLIMIT_NOFILE unless it is
> already allocated.  I.e., don't allow creating arbitrary high descriptors.
> 
> This behavior is completely consistent with the current implementation.
>  No bad surprises.  In fact, it eliminates parts of the ABI
> incompatibility I talked about.

Agreed, a new syscall looks less messy. I'll make sys_dup2() to allow 
installing in the non-sequential area, only if there's an fd already 
allocated. F_DUPFD will remain unchanged (that is, not allow 
non-sequential fds allocations).



> > Random can be expensive. At the moment is FIFO. I'm missing though how 
> > this can be a security flaw, when the legacy one is exactly predictable.
> 
> It's not an added security issue.  It would mean removing a possible
> security the current file descriptor allocation has.
> 
> If randomizing each allocator is too expensive then randomize at the
> very least the number of the first descriptor you give out.

Can you tell me how this can be a problem, and in which way making a 
random thing would help?



- Davide


  reply	other threads:[~2007-06-03 20:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-02 22:59 Davide Libenzi
2007-06-03  6:43 ` Ingo Molnar
2007-06-03 18:22   ` Davide Libenzi
2007-06-03 18:20 ` Ulrich Drepper
2007-06-03 18:53   ` Davide Libenzi
2007-06-03 19:43     ` Ulrich Drepper
2007-06-03 20:19       ` Davide Libenzi [this message]
2007-06-03 20:46         ` Ulrich Drepper
2007-06-03 23:01           ` Davide Libenzi
2007-06-03 23:09             ` Ulrich Drepper
2007-06-03 23:32               ` Davide Libenzi
2007-06-04  5:11         ` Linus Torvalds
2007-06-04  5:22           ` Ulrich Drepper

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.0706031311490.13247@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@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®