All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: David Miller <davem@davemloft.net>
Cc: Paul McKenney <paulmck@us.ibm.com>, netdev@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH 1/5] sock_create bad error return
Date: Wed, 09 Aug 2006 11:31:39 -0700	[thread overview]
Message-ID: <20060809183348.999358659@localhost.localdomain> (raw)
In-Reply-To: 20060809183138.332023530@localhost.localdomain

[-- Attachment #1: socket-get-race.patch --]
[-- Type: text/plain, Size: 551 bytes --]

If socket create call races with module unload, it correctly
fails the socket call but doesn't return an error. This race
is theoritical because the sock->ops are always the same and
non-modular.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


--- tcp-2.6.orig/net/socket.c
+++ tcp-2.6/net/socket.c
@@ -1204,6 +1204,7 @@ static int __sock_create(int family, int
 	 * socket at sock_release time we decrement its refcnt.
 	 */
 	if (!try_module_get(sock->ops->owner)) {
+		err = -EAGAIN;
 		sock->ops = NULL;
 		goto out_module_put;
 	}

--


  reply	other threads:[~2006-08-09 18:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09 18:31 [PATCH 0/5] net socket family patches Stephen Hemminger
2006-08-09 18:31 ` Stephen Hemminger [this message]
2006-08-10  3:47   ` [PATCH 1/5] sock_create bad error return David Miller
2006-08-10 17:06     ` Stephen Hemminger
2006-08-09 18:31 ` [PATCH 2/5] socket: code style cleanup Stephen Hemminger
2006-08-10  3:49   ` David Miller
2006-08-10  8:19   ` Andrew Morton
2006-08-10  8:55     ` David Miller
2006-08-09 18:31 ` [PATCH 3/5] net: drop unused elements from net_proto_family Stephen Hemminger
2006-08-10  3:50   ` David Miller
2006-08-09 18:31 ` [PATCH 4/5] net: socket family using RCU Stephen Hemminger
2006-08-10  4:00   ` David Miller
2006-08-10 18:36   ` Paul E. McKenney
2006-08-10 20:28     ` Stephen Hemminger
2006-08-11  0:46       ` Paul E. McKenney
2006-08-09 18:31 ` [PATCH 5/5] sock_register interface changes Stephen Hemminger
2006-08-10  4:03   ` David Miller
2006-08-10  0:06 ` [PATCH 0/5] net socket family patches David Miller
2006-08-10  5:36   ` Alexey Toptygin
2006-08-10 18:55     ` Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060809183348.999358659@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.