[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1341251063.2590.5.camel@bwh-desktop.uk.solarflarecom.com>
Date: Mon, 2 Jul 2012 18:44:23 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Vincent Sanders <vincent.sanders@...labora.co.uk>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Subject: Re: [PATCH net-next 09/15] net: bus: Add garbage collector for
AF_BUS sockets.
On Fri, 2012-06-29 at 17:45 +0100, Vincent Sanders wrote:
> From: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
>
> This patch adds a garbage collector for AF_BUS sockets.
[...]
> +struct sock *bus_get_socket(struct file *filp)
> +{
> + struct sock *u_sock = NULL;
> + struct inode *inode = filp->f_path.dentry->d_inode;
> +
> + /*
> + * Socket ?
> + */
> + if (S_ISSOCK(inode->i_mode) && !(filp->f_mode & FMODE_PATH)) {
> + struct socket *sock = SOCKET_I(inode);
> + struct sock *s = sock->sk;
> +
> + /*
> + * PF_BUS ?
> + */
> + if (s && sock->ops && sock->ops->family == PF_BUS)
> + u_sock = s;
> + }
> + return u_sock;
> +}
[...]
What about references cycles involving both AF_BUS and AF_UNIX sockets?
I think you must either specifically prevent passing AF_UNIX sockets
through AF_BUS sockets, or make a single garbage collector handle them
both.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists