Re: [patch 7/8] fdmap v2 - implement sys_socket2

From: Davide Libenzi
Date: Thu Jun 07 2007 - 18:40:28 EST


On Thu, 7 Jun 2007, Ulrich Drepper wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Davide Libenzi wrote:
> > What we can sanily do, is re-random the base if no fds are in there (of
> > course CLOFORK and CLOEXEC do not count).
>
> With the last comment you mean "count after CLOFORK and CLOEXEC", right?
> So the re-basing would be done in two places: after fork and after execve?

Yes. Files with the CLOFORK and CLOEXEC flag do not count for fork and
exec copies.
I was also planning on doing it in __put_unused_fd(), every time
fmap->count goes to zero. But get_random_int() is not as cheap as I
thought. If we use a cheaper (although less secure) function to mix pid &
jiffies, we could do it even in there.



- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/