2001-11-19 17:11:34

by Jeroen Vreeken

[permalink] [raw]
Subject: [PATCH] bug in sock.c

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


Attachments:
sock.c.diff (702.00 B)

2001-11-19 19:53:48

by Jeroen Vreeken

[permalink] [raw]
Subject: Re: [PATCH] bug in sock.c

This patch is so popular that some people requested it again but this time
inline :)

So here it is again:

--- 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);