Re: [PATCH] one of $BIGNUM devfs races

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Aug 06 2001 - 21:15:03 EST


On Mon, 6 Aug 2001, Richard Gooch wrote:

> Again, historical reasons. When I wrote devfs, the pipe data trampled
> the inode->u.generic_ip pointer. So that's no good. I see that the
> pipe data has been moved away. Good. Hm. But there's still the
> inode->u.socket_i structure. I'd need to check where that gets
> trampled.

It isn't. socket_i is used only in inodes allocated by sock_alloc().
It is not used in the inodes that live on any fs other than sockfs.
For local-domain socket you get _two_ kinds of inodes, both with
S_IFSOCK in ->i_mode: one on the filesystem (acting like an meeting
place) and another - bearing the actual socket and used for all IO.

In other words, the only kind you can get from mknod(2) never uses
->i_socket. It's used only by bind() and connect() - and only as
a place in namespace. The only thing we ever look at is ownership
and permissions - they determine who can bind()/connect() here.

So ->u.generic_ip is safe.

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



This archive was generated by hypermail 2b29 : Tue Aug 07 2001 - 21:00:41 EST