Skip to contentSkip to conversation

(1/13) appletalk - ddp set socket owner

PATCH New Stephen Hemminger 1 participant 1 message Aug 29, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (1/13) appletalk - ddp set socket owner

DDP needs to set the socket owner, without this it is possible to OOPS. What happens is a socket is closed, but data is outstanding so it is orphaned to be cleaned up later. Then if appletalk module is unloaded, the timer code ends up referencing dead memory.

By setting the owner field, the module can't be unloaded.

Path applies to 2.6.0-test4.

net/appletalk/ddp.c +2 -0
diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c
@@ -983,6 +983,8 @@
 	rc = 0;
 	sock->ops = &atalk_dgram_ops;
 	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
+
 	/* Checksums on by default */
 	sk->sk_zapped = 1;
 out: