Skip to contentSkip to conversation

fix CONFIG_TCP_MD5SIG + CONFIG_PREEMPT timer BUG()

PATCH In review Robert Varga 2 participants 2 messages Sep 15, 2009 – Sep 16, 2009

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

PATCH 1/1 fix CONFIG_TCP_MD5SIG + CONFIG_PREEMPT timer BUG()

Hi,

I have recently came across a preemption imbalance detected by:

<4>huh, entered ffffffff80644630 with preempt_count 00000102, exited with 00000101? <0>------------[ cut here ]------------
<2>kernel BUG at /usr/src/linux/kernel/timer.c:664!
<0>invalid opcode: 0000 [1] PREEMPT SMP

with ffffffff80644630 being inet_twdr_hangman().

This appeared after I enabled CONFIG_TCP_MD5SIG and played with it a bit, so I looked at what might have caused it.

One thing that struck me as strange is tcp_twsk_destructor(), as it calls tcp_put_md5sig_pool() -- which entails a put_cpu(), causing the detected imbalance. Found on 2.6.23.9, but 2.6.31 is affected as well, as far as I can tell.

---

net/ipv4/tcp_minisocks.c +1 -1
@@ -363,7 +363,7 @@ void tcp_twsk_destructor(struct sock *sk
 #ifdef CONFIG_TCP_MD5SIG
 	struct tcp_timewait_sock *twsk = tcp_twsk(sk);
 	if (twsk->tw_md5_keylen)
-		tcp_put_md5sig_pool();
+		tcp_free_md5sig_pool();
 #endif
 }
 
Signature · 4 lines
Bye,
Robert Varga

Reality continues to ruin my life. -- Calvin
maintainer
#1 lore raw

From: Robert Varga <[email protected]>
Date: Wed, 16 Sep 2009 01:01:26 +0200

Quoted 14 lines

Hi,

I have recently came across a preemption imbalance detected by:

<4>huh, entered ffffffff80644630 with preempt_count 00000102, exited with 00000101? <0>------------[ cut here ]------------
<2>kernel BUG at /usr/src/linux/kernel/timer.c:664!
<0>invalid opcode: 0000 [1] PREEMPT SMP

with ffffffff80644630 being inet_twdr_hangman().

This appeared after I enabled CONFIG_TCP_MD5SIG and played with it a bit, so I looked at what might have caused it.

Quoted 6 lines

One thing that struck me as strange is tcp_twsk_destructor(), as it calls tcp_put_md5sig_pool() -- which entails a put_cpu(), causing the detected imbalance. Found on 2.6.23.9, but 2.6.31 is affected as well, as far as I can tell.

Looks good, applied and queued up for stable.

Thanks!