[PATCH] bug in sock.c

Jeroen Vreeken (pe1rxq@amsat.org)
Mon, 19 Nov 2001 18:11:06 +0100


--AWniW0JNca5xppdA
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Hi,

I finally found the reason ax25 was causing oopses on several systems with
2.4.x kernels.
It was caused by a missing check for sk->dead in sock_def_write_space.
The attached patch solved my problems.

Jeroen

--AWniW0JNca5xppdA
Content-Type: application/octet-stream; charset=us-ascii
Content-Disposition: attachment; filename="sock.c.diff"

--- linux-2.4.13/net/core/sock.c Fri Nov 15 21:12:38 2001
+++ linux/net/core/sock.c Fri Nov 16 20:53:55 2001
@@ -81,6 +81,7 @@
* Andi Kleen : Fix write_space callback
* Chris Evans : Security fixes - signedness again
* Arnaldo C. Melo : cleanups, use skb_queue_purge
+ * Jeroen Vreeken : Add check for sk->dead in sock_def_write_space
*
* To Fix:
*
@@ -1130,7 +1131,7 @@
/* Do not wake up a writer until he can make "significant"
* progress. --DaveM
*/
- if((atomic_read(&sk->wmem_alloc) << 1) <= sk->sndbuf) {
+ if(!sk->dead && (atomic_read(&sk->wmem_alloc) << 1) <= sk->sndbuf) {
if (sk->sleep && waitqueue_active(sk->sleep))
wake_up_interruptible(sk->sleep);

--AWniW0JNca5xppdA--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/