Skip to contentSkip to conversation

lockdep tcp_v6_rcv message

DISCUSSION Applied Matt Domsch 5 participants 9 messages Jul 28, 2006 – Aug 1, 2006

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

Triggered on Fedora rawhide kernel-2.6.17-1.2462.fc6 x86_64 which is based on 2.6.18rc2-git6. IPv6 was in use at the time.

=================================
[ INFO: inconsistent lock state ]
---------------------------------
inconsistent {softirq-on-W} -> {in-softirq-R} usage. swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
(&sk->sk_dst_lock){---?}, at: [<ffffffff80418ef3>] sk_dst_check+0x26/0x12b
{softirq-on-W} state was registered at:

  [<ffffffff802a874d>] lock_acquire+0x4a/0x69
  [<ffffffff802672a1>] _write_lock+0x24/0x31
  [<ffffffff8044a26b>] ip4_datagram_connect+0x2e1/0x350
  [<ffffffff80451214>] inet_dgram_connect+0x57/0x65
  [<ffffffff8041652a>] sys_connect+0x7d/0xa4
  [<ffffffff8025ff0d>] system_call+0x7d/0x83
irq event stamp: 3507830
hardirqs last  enabled at (3507830): [<ffffffff8020aaa8>]
kmem_cache_alloc+0xd3/0xf7
hardirqs last disabled at (3507829): [<ffffffff8020aa20>]
kmem_cache_alloc+0x4b/0xf7
softirqs last  enabled at (3507808): [<ffffffff80212a9d>]
__do_softirq+0xec/0xf5
softirqs last disabled at (3507811): [<ffffffff802611ba>]
call_softirq+0x1e/0x28

other info that might help us debug this:
1 lock held by swapper/0:
#0: (slock-AF_INET6){-+..}, at: [<ffffffff883dc3d6>]

 tcp_v6_rcv+0x30e/0x770 [ipv6]

stack backtrace:

Call Trace:
 [<ffffffff8026e269>] show_trace+0xaa/0x23d
 [<ffffffff8026e411>] dump_stack+0x15/0x17
 [<ffffffff802a67bd>] print_usage_bug+0x259/0x26a
 [<ffffffff802a6fc2>] mark_lock+0x1d5/0x3e3
 [<ffffffff802a7b80>] __lock_acquire+0x427/0xa54
 [<ffffffff802a874e>] lock_acquire+0x4b/0x69
 [<ffffffff802673b8>] _read_lock+0x28/0x34
 [<ffffffff80418ef3>] sk_dst_check+0x26/0x12b
 [<ffffffff883bd9be>] :ipv6:ip6_dst_lookup+0x3a/0x1a2
 [<ffffffff883d9dcf>] :ipv6:tcp_v6_send_synack+0x185/0x2ec
 [<ffffffff883dac02>] :ipv6:tcp_v6_conn_request+0x291/0x2f3
 [<ffffffff80243ce6>] tcp_rcv_state_process+0x5f/0xe7b
 [<ffffffff883da1bd>] :ipv6:tcp_v6_do_rcv+0x268/0x372
 [<ffffffff883dc7e7>] :ipv6:tcp_v6_rcv+0x71f/0x770
 [<ffffffff883bf4ef>] :ipv6:ip6_input+0x223/0x315
 [<ffffffff883bfb9d>] :ipv6:ipv6_rcv+0x254/0x2af
 [<ffffffff8022154d>] netif_receive_skb+0x260/0x2dd
 [<ffffffff881163ef>] :e1000:e1000_clean_rx_irq+0x423/0x4c2
 [<ffffffff881148c9>] :e1000:e1000_clean+0x88/0x15b
 [<ffffffff8020cc82>] net_rx_action+0xac/0x1c7
 [<ffffffff80212a19>] __do_softirq+0x68/0xf5
 [<ffffffff802611ba>] call_softirq+0x1e/0x28

Thanks,
Matt

Signature · 4 lines
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#1 lore raw

[IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

Quoted 11 lines · Matt Domsch

Triggered on Fedora rawhide kernel-2.6.17-1.2462.fc6 x86_64 which is based on 2.6.18rc2-git6. IPv6 was in use at the time.

=================================
[ INFO: inconsistent lock state ]
---------------------------------
inconsistent {softirq-on-W} -> {in-softirq-R} usage. swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
(&sk->sk_dst_lock){---?}, at: [<ffffffff80418ef3>] sk_dst_check+0x26/0x12b
{softirq-on-W} state was registered at:

Quoted 6 lines
  [<ffffffff802a874d>] lock_acquire+0x4a/0x69
  [<ffffffff802672a1>] _write_lock+0x24/0x31
  [<ffffffff8044a26b>] ip4_datagram_connect+0x2e1/0x350
  [<ffffffff80451214>] inet_dgram_connect+0x57/0x65
  [<ffffffff8041652a>] sys_connect+0x7d/0xa4
  [<ffffffff8025ff0d>] system_call+0x7d/0x83

Thanks for the report. This is actually a false positive because by these two paths can't intersect since one is a UDP while the other is TCP.

However, here is a patch which should shut up the validator as well as removing unnecessary locking from most callers of ip6_dst_lookup.

[IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

The current users of ip6_dst_lookup can be divided into two classes:

1) The caller holds no locks and is in user-context (UDP).
2) The caller does not want to lookup the dst cache at all.

The second class covers everyone except UDP because most people do the cache lookup directly before calling ip6_dst_lookup. This patch adds ip6_sk_dst_lookup for the first class.

Similarly ip6_dst_store users can be divded into those that need to take the socket dst lock and those that don't. This patch adds __ip6_dst_store for those (everyone except UDP/datagram) that don't need an extra lock.

Cheers,

Signature · 5 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
include/net/ip6_route.h +9 -3
index ab29daf..96b0e66 100644
@@ -139,16 +139,22 @@ extern rwlock_t rt6_lock;
 /*
  *	Store a destination cache entry in a socket
  */
-static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
-				     struct in6_addr *daddr)
+static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
+				   struct in6_addr *daddr)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct rt6_info *rt = (struct rt6_info *) dst;
 
-	write_lock(&sk->sk_dst_lock);
 	sk_setup_caps(sk, dst);
 	np->daddr_cache = daddr;
 	np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
+}
+
+static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
+				 struct in6_addr *daddr)
+{
+	write_lock(&sk->sk_dst_lock);
+	__ip6_dst_store(sk, dst, daddr);
 	write_unlock(&sk->sk_dst_lock);
 }
 
include/net/ipv6.h +3 -0
index a8fdf79..ece7e8a 100644
@@ -468,6 +468,9 @@ extern void			ip6_flush_pending_frames(s
 extern int			ip6_dst_lookup(struct sock *sk,
 					       struct dst_entry **dst,
 					       struct flowi *fl);
+extern int			ip6_sk_dst_lookup(struct sock *sk,
+						  struct dst_entry **dst,
+						  struct flowi *fl);
 
 /*
  *	skb processing functions
net/dccp/ipv6.c +2 -2
index 9f3d4d7..610c722 100644
@@ -230,7 +230,7 @@ static int dccp_v6_connect(struct sock *
 	ipv6_addr_copy(&np->saddr, saddr);
 	inet->rcv_saddr = LOOPBACK4_IPV6;
 
-	ip6_dst_store(sk, dst, NULL);
+	__ip6_dst_store(sk, dst, NULL);
 
 	icsk->icsk_ext_hdr_len = 0;
 	if (np->opt != NULL)
@@ -863,7 +863,7 @@ static struct sock *dccp_v6_request_recv
 	 * comment in that function for the gory details. -acme
 	 */
 
-	ip6_dst_store(newsk, dst, NULL);
+	__ip6_dst_store(newsk, dst, NULL);
 	newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM |
 						      NETIF_F_TSO);
 	newdp6 = (struct dccp6_sock *)newsk;
net/ipv6/af_inet6.c +1 -1
index 5a0ba58..ac85e9c 100644
@@ -658,7 +658,7 @@ int inet6_sk_rebuild_header(struct sock 
 			return err;
 		}
 
-		ip6_dst_store(sk, dst, NULL);
+		__ip6_dst_store(sk, dst, NULL);
 	}
 
 	return 0;
net/ipv6/inet6_connection_sock.c +1 -1
index 5c950cc..bf49107 100644
@@ -185,7 +185,7 @@ int inet6_csk_xmit(struct sk_buff *skb, 
 			return err;
 		}
 
-		ip6_dst_store(sk, dst, NULL);
+		__ip6_dst_store(sk, dst, NULL);
 	}
 
 	skb->dst = dst_clone(dst);
net/ipv6/ip6_output.c +81 -39

144 lines not on this page · raw message

net/ipv6/tcp_ipv6.c +2 -2
index 923989d..b76fd7f 100644
@@ -270,7 +270,7 @@ static int tcp_v6_connect(struct sock *s
 	inet->rcv_saddr = LOOPBACK4_IPV6;
 
 	sk->sk_gso_type = SKB_GSO_TCPV6;
-	ip6_dst_store(sk, dst, NULL);
+	__ip6_dst_store(sk, dst, NULL);
 
 	icsk->icsk_ext_hdr_len = 0;
 	if (np->opt)
@@ -947,7 +947,7 @@ static struct sock * tcp_v6_syn_recv_soc
 	 */
 
 	sk->sk_gso_type = SKB_GSO_TCPV6;
-	ip6_dst_store(newsk, dst, NULL);
+	__ip6_dst_store(newsk, dst, NULL);
 
 	newtcp6sk = (struct tcp6_sock *)newsk;
 	inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
net/ipv6/udp.c +1 -1
index ccc57f4..3d54f24 100644
@@ -782,7 +782,7 @@ do_udp_sendmsg:
 		connected = 0;
 	}
 
-	err = ip6_dst_lookup(sk, &dst, fl);
+	err = ip6_sk_dst_lookup(sk, &dst, fl);
 	if (err)
 		goto out;
 	if (final_p)
maintainer Applied
#2 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

From: Herbert Xu <[email protected]>
Date: Sat, 29 Jul 2006 14:33:25 +1000

Quoted 11 lines

[IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

The current users of ip6_dst_lookup can be divided into two classes:

1) The caller holds no locks and is in user-context (UDP).
2) The caller does not want to lookup the dst cache at all.

The second class covers everyone except UDP because most people do the cache lookup directly before calling ip6_dst_lookup. This patch adds ip6_sk_dst_lookup for the first class.

Quoted 6 lines

Similarly ip6_dst_store users can be divded into those that need to take the socket dst lock and those that don't. This patch adds __ip6_dst_store for those (everyone except UDP/datagram) that don't need an extra lock.

Applied, thanks Herbert.

#3 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

Quoted 14 lines · David Miller

From: Herbert Xu <[email protected]>
Date: Sat, 29 Jul 2006 14:33:25 +1000

Quoted 11 lines

[IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

The current users of ip6_dst_lookup can be divided into two classes:

1) The caller holds no locks and is in user-context (UDP).
2) The caller does not want to lookup the dst cache at all.

The second class covers everyone except UDP because most people do the cache lookup directly before calling ip6_dst_lookup. This patch adds ip6_sk_dst_lookup for the first class.

Quoted 8 lines
Quoted 6 lines

Similarly ip6_dst_store users can be divded into those that need to take the socket dst lock and those that don't. This patch adds __ip6_dst_store for those (everyone except UDP/datagram) that don't need an extra lock.

Applied, thanks Herbert.

I applied this on 2.6.18-rc3, and it panics immediately as the first IPv6 TCP (ssh) session is initiated to the system.

Signature · 104 lines
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

Bootdata ok (command line is ro root=/dev/VolGroup00/LogVol00 console=ttyS0,115200 console=tty0)
Linux version 2.6.18-rc3 ([email protected]) (gcc version 4.1.1 20060721 (Red Hat 4.1.1-13)) #1 SMP Sun Jul 30 22:08:46 CDT 2006
...
=============================================
[ INFO: possible recursive locking detected ]
---------------------------------------------
swapper/0 is trying to acquire lock:
 (slock-AF_INET6){-+..}, at: [<ffffffff80414fda>] sk_clone+0xd2/0x3a8

but task is already holding lock:
 (slock-AF_INET6){-+..}, at: [<ffffffff883d71a8>] tcp_v6_rcv+0x30e/0x76e [ipv6]

other info that might help us debug this:
1 lock held by swapper/0:
 #0:  (slock-AF_INET6){-+..}, at: [<ffffffff883d71a8>] tcp_v6_rcv+0x30e/0x76e [ipv6]

stack backtrace:

Call Trace:
 [<ffffffff8026f861>] show_trace+0xae/0x30e
 [<ffffffff8026fad6>] dump_stack+0x15/0x17
 [<ffffffff802a73d4>] __lock_acquire+0x12e/0xa18
 [<ffffffff802a8232>] lock_acquire+0x4b/0x69
 [<ffffffff8026883b>] _spin_lock+0x25/0x31
 [<ffffffff80414fda>] sk_clone+0xd2/0x3a8
 [<ffffffff8043c8a7>] inet_csk_clone+0x11/0x6f
 [<ffffffff80445615>] tcp_create_openreq_child+0x24/0x49c
 [<ffffffff883d5d85>] :ipv6:tcp_v6_syn_recv_sock+0x2c5/0x6be
 [<ffffffff80445c5e>] tcp_check_req+0x1d1/0x326
 [<ffffffff883d4f0e>] :ipv6:tcp_v6_do_rcv+0x15d/0x372
 [<ffffffff883d75b9>] :ipv6:tcp_v6_rcv+0x71f/0x76e
 [<ffffffff883ba49f>] :ipv6:ip6_input+0x223/0x315
 [<ffffffff883bab4d>] :ipv6:ipv6_rcv+0x254/0x2af
 [<ffffffff80221883>] netif_receive_skb+0x260/0x2dd
 [<ffffffff88101292>] :e1000:e1000_clean_rx_irq+0x423/0x4c2
 [<ffffffff880ff752>] :e1000:e1000_clean+0x88/0x17d
 [<ffffffff8020caed>] net_rx_action+0xac/0x1d1
 [<ffffffff80212809>] __do_softirq+0x68/0xf5
 [<ffffffff802626fa>] call_softirq+0x1e/0x28
DWARF2 unwinder stuck at call_softirq+0x1e/0x28
Leftover inexact backtrace:
 <IRQ> [<ffffffff80270b48>] do_softirq+0x39/0x9f
 [<ffffffff802960b6>] irq_exit+0x57/0x59
 [<ffffffff80270cab>] do_IRQ+0xfd/0x107
 [<ffffffff8025b612>] mwait_idle+0x0/0x54
 [<ffffffff80261985>] ret_from_intr+0x0/0xf
 <EOI><1>Unable to handle kernel paging request at ffffffff82800000 RIP: 
 [<ffffffff8026fa5c>] show_trace+0x2a9/0x30e
PGD 203027 PUD 205027 PMD 0 
Oops: 0000 [1] SMP 
CPU 0 
Modules linked in: ipv6 ipmi_devintf ipmi_si ipmi_msghandler hidp rfcomm l2cap bluetooth sunrpc ip_conntrack_netbios_ns ipt_REJECT xt_state ip_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables x_tables acpi_cpufreq video sbs i2c_ec i2c_core button battery asus_acpi ac parport_pc lp parport intel_rng uhci_hcd ehci_hcd ide_cd e752x_edac edac_mc pcspkr serio_raw cdrom sg e1000 dm_snapshot dm_zero dm_mirror dm_mod ext3 jbd ata_piix libata sd_mod scsi_mod
Pid: 0, comm: swapper Not tainted 2.6.18-rc3 #1
RIP: 0010:[<ffffffff8026fa5c>]  [<ffffffff8026fa5c>] show_trace+0x2a9/0x30e
RSP: 0018:ffffffff8066a8f0  EFLAGS: 00010002
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000a4ec
RDX: ffffffff80561e60 RSI: 0000000000000000 RDI: ffffffff8056e020
RBP: ffffffff8066a9e0 R08: ffffffff8066a640 R09: ffffffff802abf75
R10: ffffffff802abf75 R11: 0000000000000000 R12: ffffffff827ffffd
R13: ffffffff8066a900 R14: 0000000000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffffffff80922000(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: ffffffff82800000 CR3: 0000000076417000 CR4: 00000000000006e0
Process swapper (pid: 0, threadinfo ffffffff80952000, task ffffffff80561e60)
Stack:  ffffffff8066a900 00000000805625b0 0000000000000000 0000000000000000
 0000000000000000 ffffffff80953ec8 ffffffff8066af80 0000000000000046
 0000000000000000 0000000000000000 0000000000000000 0000000000000000
Call Trace:
 [<ffffffff8026fad6>] dump_stack+0x15/0x17
 [<ffffffff802a73d4>] __lock_acquire+0x12e/0xa18
 [<ffffffff802a8232>] lock_acquire+0x4b/0x69
 [<ffffffff8026883b>] _spin_lock+0x25/0x31
 [<ffffffff80414fda>] sk_clone+0xd2/0x3a8
 [<ffffffff8043c8a7>] inet_csk_clone+0x11/0x6f
 [<ffffffff80445615>] tcp_create_openreq_child+0x24/0x49c
 [<ffffffff883d5d85>] :ipv6:tcp_v6_syn_recv_sock+0x2c5/0x6be
 [<ffffffff80445c5e>] tcp_check_req+0x1d1/0x326
 [<ffffffff883d4f0e>] :ipv6:tcp_v6_do_rcv+0x15d/0x372
 [<ffffffff883d75b9>] :ipv6:tcp_v6_rcv+0x71f/0x76e
 [<ffffffff883ba49f>] :ipv6:ip6_input+0x223/0x315
 [<ffffffff883bab4d>] :ipv6:ipv6_rcv+0x254/0x2af
 [<ffffffff80221883>] netif_receive_skb+0x260/0x2dd
 [<ffffffff88101292>] :e1000:e1000_clean_rx_irq+0x423/0x4c2
 [<ffffffff880ff752>] :e1000:e1000_clean+0x88/0x17d
 [<ffffffff8020caed>] net_rx_action+0xac/0x1d1
 [<ffffffff80212809>] __do_softirq+0x68/0xf5
 [<ffffffff802626fa>] call_softirq+0x1e/0x28
DWARF2 unwinder stuck at call_softirq+0x1e/0x28
Leftover inexact backtrace:
 <IRQ> [<ffffffff80270b48>] do_softirq+0x39/0x9f
 [<ffffffff802960b6>] irq_exit+0x57/0x59
 [<ffffffff80270cab>] do_IRQ+0xfd/0x107
 [<ffffffff8025b612>] mwait_idle+0x0/0x54
 [<ffffffff80261985>] ret_from_intr+0x0/0xf
 <EOI><1>Unable to handle kernel paging request at ffffffff82800000 RIP: 
 [<ffffffff8026fa5c>] show_trace+0x2a9/0x30e
PGD 203027 PUD 205027 PMD 0 

(more oopses followed, though they look the same).
maintainer
#4 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

From: Matt Domsch <[email protected]>
Date: Sun, 30 Jul 2006 22:32:10 -0500

Quoted 5 lines

swapper/0 is trying to acquire lock:
(slock-AF_INET6){-+..}, at: [<ffffffff80414fda>] sk_clone+0xd2/0x3a8

but task is already holding lock:
(slock-AF_INET6){-+..}, at: [<ffffffff883d71a8>] tcp_v6_rcv+0x30e/0x76e [ipv6]

The tcp_v6_rcv() code path is holding the slock on the parent listening socket, whereas in sk_clone() we have grabbed the socket slock on the newly allocated "newsk" socket. These are thus two seperate locks, although they are in the same locking class "slock-AF_INET6".

I don't know why the lock validator is complaining about this.

#5 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

In reply to Matt Domsch
Quoted 20 lines · Matt Domsch
Quoted 19 lines · David Miller

From: Herbert Xu <[email protected]>
Date: Sat, 29 Jul 2006 14:33:25 +1000

Quoted 16 lines

[IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

The current users of ip6_dst_lookup can be divided into two classes:

1) The caller holds no locks and is in user-context (UDP).
2) The caller does not want to lookup the dst cache at all.

The second class covers everyone except UDP because most people do the cache lookup directly before calling ip6_dst_lookup. This patch adds ip6_sk_dst_lookup for the first class.

Similarly ip6_dst_store users can be divded into those that need to take the socket dst lock and those that don't. This patch adds __ip6_dst_store for those (everyone except UDP/datagram) that don't need an extra lock.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks Herbert.

I applied this on 2.6.18-rc3, and it panics immediately as the first IPv6 TCP (ssh) session is initiated to the system.

I backed out this patch, and get a somewhat different failure then with 2.6.18-rc3 plain. The oops repeat continuously with <EOI> after each. Again, this occurs as soon as I start an IPv6 ssh session.

Signature · 113 lines
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

Linux version 2.6.18-rc3 ([email protected]) (gcc version 4.1.1 20060721 (Red Hat 4.1.1-13)) #2 SMP Sun Jul 30 23:06:48 CDT 2006
=================================
[ INFO: inconsistent lock state ]
---------------------------------
inconsistent {softirq-on-W} -> {in-softirq-R} usage.
swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
 (&sk->sk_dst_lock){---?}, at: [<ffffffff80415827>] sk_dst_check+0x26/0x113
{softirq-on-W} state was registered at:
  [<ffffffff802a8231>] lock_acquire+0x4a/0x69
  [<ffffffff802688a1>] _write_lock+0x24/0x31
  [<ffffffff8044d9a4>] inet_bind+0x198/0x20b
  [<ffffffff80412ed4>] sys_bind+0x75/0x9c
  [<ffffffff8026144d>] system_call+0x7d/0x83
irq event stamp: 604084
hardirqs last  enabled at (604084): [<ffffffff8020aab2>] kmem_cache_alloc+0xd3/0xf7
hardirqs last disabled at (604083): [<ffffffff8020aa2a>] kmem_cache_alloc+0x4b/0xf7
softirqs last  enabled at (604026): [<ffffffff8021288d>] __do_softirq+0xec/0xf5
softirqs last disabled at (604029): [<ffffffff802626fa>] call_softirq+0x1e/0x28

other info that might help us debug this:
1 lock held by swapper/0:
 #0:  (slock-AF_INET6){-+..}, at: [<ffffffff883d91df>] tcp_v6_rcv+0x30e/0x76f [ipv6]

stack backtrace:

Call Trace:
 [<ffffffff8026f861>] show_trace+0xae/0x30e
 [<ffffffff8026fad6>] dump_stack+0x15/0x17
 [<ffffffff802a634f>] print_usage_bug+0x259/0x26a
 [<ffffffff802a6b38>] mark_lock+0x1d5/0x3db
 [<ffffffff802a76b8>] __lock_acquire+0x412/0xa18
 [<ffffffff802a8232>] lock_acquire+0x4b/0x69
 [<ffffffff802689b8>] _read_lock+0x28/0x34
 [<ffffffff80415827>] sk_dst_check+0x26/0x113
 [<ffffffff883ba986>] :ipv6:ip6_dst_lookup+0x3a/0x192
 [<ffffffff883d6c2f>] :ipv6:tcp_v6_send_synack+0x185/0x2e4
 [<ffffffff883d7a5a>] :ipv6:tcp_v6_conn_request+0x291/0x2f3
 [<ffffffff802455c2>] tcp_rcv_state_process+0x5f/0xe7c
 [<ffffffff883d7015>] :ipv6:tcp_v6_do_rcv+0x268/0x372
 [<ffffffff883d95f0>] :ipv6:tcp_v6_rcv+0x71f/0x76f
 [<ffffffff883bc48f>] :ipv6:ip6_input+0x223/0x315
 [<ffffffff883bcb3d>] :ipv6:ipv6_rcv+0x254/0x2af
 [<ffffffff80221883>] netif_receive_skb+0x260/0x2dd
 [<ffffffff88194292>] :e1000:e1000_clean_rx_irq+0x423/0x4c2
 [<ffffffff88192752>] :e1000:e1000_clean+0x88/0x17d
 [<ffffffff8020caed>] net_rx_action+0xac/0x1d1
 [<ffffffff80212809>] __do_softirq+0x68/0xf5
 [<ffffffff802626fa>] call_softirq+0x1e/0x28
DWARF2 unwinder stuck at call_softirq+0x1e/0x28
Leftover inexact backtrace:
 <IRQ> [<ffffffff80270b48>] do_softirq+0x39/0x9f
 [<ffffffff802960b6>] irq_exit+0x57/0x59
 [<ffffffff80270cab>] do_IRQ+0xfd/0x107
 [<ffffffff8025b612>] mwait_idle+0x0/0x54
 [<ffffffff80261985>] ret_from_intr+0x0/0xf
 <EOI>

<1>Unable to handle kernel paging request at ffffffff82800000 RIP: 
 [<ffffffff8026fa5c>] show_trace+0x2a9/0x30e
PGD 203027 PUD 205027 PMD 0 
Oops: 0000 [1] SMP 
CPU 0 
Modules linked in: ipv6 ipmi_devintf ipmi_si ipmi_msghandler hidp rfcomm l2cap bluetooth sunrpc ip_conntrack_netbios_ns ipt_REJECT xt_state ip_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables x_tables acpi_cpufreq video sbs i2c_ec i2c_core button battery asus_acpi ac parport_pc lp parport intel_rng e1000 sg ehci_hcd ide_cd cdrom pcspkr serio_raw e752x_edac edac_mc uhci_hcd dm_snapshot dm_zero dm_mirror dm_mod ext3 jbd ata_piix libata sd_mod scsi_mod
Pid: 0, comm: swapper Not tainted 2.6.18-rc3 #2
RIP: 0010:[<ffffffff8026fa5c>]  [<ffffffff8026fa5c>] show_trace+0x2a9/0x30e
RSP: 0018:ffffffff8066a850  EFLAGS: 00010002
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000a4ec
RDX: ffffffff80561e60 RSI: 0000000000000000 RDI: ffffffff8056e020
RBP: ffffffff8066a940 R08: ffffffff8066a5a0 R09: ffffffff802abf75
R10: ffffffff802abf75 R11: 0000000000000000 R12: ffffffff827ffffd
R13: ffffffff8066a860 R14: 0000000000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffffffff80922000(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: ffffffff82800000 CR3: 0000000072e0b000 CR4: 00000000000006e0
Process swapper (pid: 0, threadinfo ffffffff80952000, task ffffffff80561e60)
Stack:  ffffffff8066a860 0000000080725708 0000000000000000 0000000000000000
 0000000000000000 ffffffff80953ec8 ffffffff8066af80 0000000000000046
 0000000000000000 0000000000000000 0000000000000000 0000000000000000
Call Trace:
 [<ffffffff8026fad6>] dump_stack+0x15/0x17
 [<ffffffff802a634f>] print_usage_bug+0x259/0x26a
 [<ffffffff802a6b38>] mark_lock+0x1d5/0x3db
 [<ffffffff802a76b8>] __lock_acquire+0x412/0xa18
 [<ffffffff802a8232>] lock_acquire+0x4b/0x69
 [<ffffffff802689b8>] _read_lock+0x28/0x34
 [<ffffffff80415827>] sk_dst_check+0x26/0x113
 [<ffffffff883ba986>] :ipv6:ip6_dst_lookup+0x3a/0x192
 [<ffffffff883d6c2f>] :ipv6:tcp_v6_send_synack+0x185/0x2e4
 [<ffffffff883d7a5a>] :ipv6:tcp_v6_conn_request+0x291/0x2f3
 [<ffffffff802455c2>] tcp_rcv_state_process+0x5f/0xe7c
 [<ffffffff883d7015>] :ipv6:tcp_v6_do_rcv+0x268/0x372
 [<ffffffff883d95f0>] :ipv6:tcp_v6_rcv+0x71f/0x76f
 [<ffffffff883bc48f>] :ipv6:ip6_input+0x223/0x315
 [<ffffffff883bcb3d>] :ipv6:ipv6_rcv+0x254/0x2af
 [<ffffffff80221883>] netif_receive_skb+0x260/0x2dd
 [<ffffffff88194292>] :e1000:e1000_clean_rx_irq+0x423/0x4c2
 [<ffffffff88192752>] :e1000:e1000_clean+0x88/0x17d
 [<ffffffff8020caed>] net_rx_action+0xac/0x1d1
 [<ffffffff80212809>] __do_softirq+0x68/0xf5
 [<ffffffff802626fa>] call_softirq+0x1e/0x28
DWARF2 unwinder stuck at call_softirq+0x1e/0x28
Leftover inexact backtrace:
 <IRQ> [<ffffffff80270b48>] do_softirq+0x39/0x9f
 [<ffffffff802960b6>] irq_exit+0x57/0x59
 [<ffffffff80270cab>] do_IRQ+0xfd/0x107
 [<ffffffff8025b612>] mwait_idle+0x0/0x54
 [<ffffffff80261985>] ret_from_intr+0x0/0xf
 <EOI>
#6 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

In reply to Matt Domsch
Quoted 3 lines · Matt Domsch

I applied this on 2.6.18-rc3, and it panics immediately as the first IPv6 TCP (ssh) session is initiated to the system.

Executive summary:

1) We resolved one lockdep warning only to stumble onto another lockdep validator bug.

2) There is something broken in the x86_64 unwind code which is causing it to panic just about everytime somebody calls dump_stack().

Andi, this is the second time I've seen a report where an otherwise harmless dump_stack call (the other one was caused by a WARN_ON) gets turned into a panic by the stack unwind code on x86_64. This particular report is with 2.6.18-rc3 so it looks like whatever bug is causing it hasn't been fixed yet.

Could you please have a look at it? Thanks.

Quoted 28 lines

=============================================
[ INFO: possible recursive locking detected ]
---------------------------------------------
swapper/0 is trying to acquire lock:
(slock-AF_INET6){-+..}, at: [<ffffffff80414fda>] sk_clone+0xd2/0x3a8

but task is already holding lock:
(slock-AF_INET6){-+..}, at: [<ffffffff883d71a8>] tcp_v6_rcv+0x30e/0x76e [ipv6]

other info that might help us debug this:
1 lock held by swapper/0:
#0: (slock-AF_INET6){-+..}, at: [<ffffffff883d71a8>] tcp_v6_rcv+0x30e/0x76e [ipv6]

stack backtrace:

Call Trace:
 [<ffffffff8026f861>] show_trace+0xae/0x30e
 [<ffffffff8026fad6>] dump_stack+0x15/0x17
 [<ffffffff802a73d4>] __lock_acquire+0x12e/0xa18
 [<ffffffff802a8232>] lock_acquire+0x4b/0x69
 [<ffffffff8026883b>] _spin_lock+0x25/0x31
 [<ffffffff80414fda>] sk_clone+0xd2/0x3a8
 [<ffffffff8043c8a7>] inet_csk_clone+0x11/0x6f
 [<ffffffff80445615>] tcp_create_openreq_child+0x24/0x49c
 [<ffffffff883d5d85>] :ipv6:tcp_v6_syn_recv_sock+0x2c5/0x6be
 [<ffffffff80445c5e>] tcp_check_req+0x1d1/0x326
 [<ffffffff883d4f0e>] :ipv6:tcp_v6_do_rcv+0x15d/0x372
 [<ffffffff883d75b9>] :ipv6:tcp_v6_rcv+0x71f/0x76e
Quoted 8 lines
 [<ffffffff883ba49f>] :ipv6:ip6_input+0x223/0x315
 [<ffffffff883bab4d>] :ipv6:ipv6_rcv+0x254/0x2af
 [<ffffffff80221883>] netif_receive_skb+0x260/0x2dd
 [<ffffffff88101292>] :e1000:e1000_clean_rx_irq+0x423/0x4c2
 [<ffffffff880ff752>] :e1000:e1000_clean+0x88/0x17d
 [<ffffffff8020caed>] net_rx_action+0xac/0x1d1
 [<ffffffff80212809>] __do_softirq+0x68/0xf5
 [<ffffffff802626fa>] call_softirq+0x1e/0x28

Now let's move onto the lockdep validator bug :)

Ingo/Arjen, I thought we've already fixed this before but somehow I can't find anything in the email archives so perhaps I'm mixing it up with another recursive lock false-positive.

The problem here is really quite simple: when we accept a TCP connection there are two sockets involved. The listening socket which existed before the connection came in and the socket we construct for the newly arrived connection.

The code works something like this:

* Take slock on listening socket.
* Construct child socket.
* Take slock on child socket.

As we never do the locking in the opposite direction (child followed by listening socket) this is safe.

So perhaps we need to add some extra annotation in sk_clone?

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#7 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

Quoted 10 lines · On Mon, 31 Jul 2006 19:04:33 +1000 Herbert Xu <[email protected]>…

2) There is something broken in the x86_64 unwind code which is causing it to panic just about everytime somebody calls dump_stack().

Andi, this is the second time I've seen a report where an otherwise harmless dump_stack call (the other one was caused by a WARN_ON) gets turned into a panic by the stack unwind code on x86_64. This particular report is with 2.6.18-rc3 so it looks like whatever bug is causing it hasn't been fixed yet.

Could you please have a look at it? Thanks.

Jan thinks this might have been fixed by a patch which he sent Andi a couple of days ago. Andi has sent that patch to Linus but I'm not sure which patch it was and I'm not sure whether it has been merged into mainline.

But yes, -rc3 unwind has problems.

#8 lore raw

Re: [IPV6]: Audit all ip6_dst_lookup/ip6_dst_store calls

Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Mon, 31 Jul 2006 19:04:33 +1000 Herbert Xu <[email protected]>…

2) There is something broken in the x86_64 unwind code which is causing it to panic just about everytime somebody calls dump_stack().

Andi, this is the second time I've seen a report where an otherwise harmless dump_stack call (the other one was caused by a WARN_ON) gets turned into a panic by the stack unwind code on x86_64. This particular report is with 2.6.18-rc3 so it looks like whatever bug is causing it hasn't been fixed yet.

Quoted 4 lines
Quoted 1 line

Could you please have a look at it? Thanks.

Jan thinks this might have been fixed by a patch which he sent Andi a couple of days ago. Andi has sent that patch to Linus

I didn't send that particular patch before, just queued it, because I didn't realize that particular crash, but I have now send it yesterday. So far L. hasn't merged it unfortunately, but I will resend.

Quoted 2 lines

but I'm not sure
which patch it was

"entry-more-unwind" was my version, there was another one from Jan

Quoted 4 lines

and I'm not sure whether it has been merged into
mainline.

But yes, -rc3 unwind has problems.

"unwinder stuck" messages are expected and not really fatal because they don't lose any information. I expect it will need some releases to work them all out fully, but then we'll hopefully have a much better unwinder that doesn't generate any false positives anymore.

New crashes during unwinding are fatal though and I plan to fix them. So far this one was the only known one.

I already got a lot of patches queued for .19 that fix more unwind information in a lot of assembly files. Still not fully complete though. Fixing it all properly unfortunately requires undoing some stuff, e.g. the unwinder cannot deal with separate lock sections, so I was slowly removing them.

-Andi