[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6FA1@saturn3.aculab.com>
Date: Mon, 23 Jul 2012 10:43:18 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Al Viro" <viro@...IV.linux.org.uk>,
"David Miller" <davem@...emloft.net>
Cc: <mikulas@...ax.karlin.mff.cuni.cz>, <eric.dumazet@...il.com>,
<maxk@...lcomm.com>, <vtun@...ice.satix.net>,
<netdev@...r.kernel.org>,
"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
<linux-sctp@...r.kernel.org>
Subject: RE: [PATCH] Crash in tun
> BTW, speaking of struct file treatment related to sockets -
> there's this piece of code in iscsi:
> /*
> * The SCTP stack needs struct socket->file.
> */
> if ((np->np_network_transport == ISCSI_SCTP_TCP) ||
> (np->np_network_transport == ISCSI_SCTP_UDP)) {
> if (!new_sock->file) {
> new_sock->file = kzalloc(
> sizeof(struct file),
> GFP_KERNEL);
>
> For one thing, as far as I can see it'not true - sctp does *not*
> depend on socket->file being non-NULL; it does, in one place,
> check socket->file->f_flags for O_NONBLOCK, but there it treats
> NULL socket->file as "flag no set".
The SCTP code certainly has unconditionally looked at file->f_flags,
we had to allocate a 'struct file' for our in-kernel socket code.
We set sock->file = NULL before the sock_release() call so
hopefully don't suffer the 'side effects'.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists