Thread (11 messages) flat view 11 messages, 7 authors, 2012-07-23

RE: [PATCH] Crash in tun

From: David Laight <hidden>
Date: 2012-07-23 09:44:10
Also in: linux-sctp

	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help