Re: [PATCH] one of $BIGNUM devfs races

Alexander Viro (viro@math.psu.edu)
Mon, 6 Aug 2001 22:15:03 -0400 (EDT)


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/