Re: lock order reversal on startup (rtentry, ifnet_sx)

From: Michael Tuexen <tuexen_at_fh-muenster.de>
Date: Wed, 28 Oct 2009 07:37:31 +0100
Hi Ben,

does

Index: route.c
===================================================================
--- route.c	(revision 197953)
+++ route.c	(working copy)
_at__at_ -1497,7 +1497,11 _at__at_
  			    ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index =
  				rt->rt_ifp->if_index;
  			}
+			RT_ADDREF(rt);
+			RT_UNLOCK(rt);
  			rt_newaddrmsg(cmd, ifa, error, rt);
+			RT_LOCK(rt);
+			RT_REMREF(rt);
  			if (cmd == RTM_DELETE) {
  				/*
  				 * If we are deleting, and we found an entry,


fix the issue?

Best regards
Michael

On Oct 28, 2009, at 1:25 AM, Benjamin Kaduk wrote:

> Hi all,
>
> I don't see this explicitly mentioned before, nor on
> http://sources.zabbadoz.net/freebsd/lor.html
>
> It shows up on startup with a -current from two days ago.
> Looking at the svn logs, maybe it was introduced with r197328?
>
>
> lock order reversal: (sleepable after non-sleepable)
> 1st 0xffffff0002d360a8 rtentry (rtentry) _at_ /usr/src/sys/net/route.c: 
> 1474
> 2nd 0xffffffff80e00b00 ifnet_sx (ifnet_sx) _at_ /usr/src/sys/netinet/ 
> sctp_bsd_addr.c:212
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2a
> _witness_debugger() at _witness_debugger+0x2e
> witness_checkorder() at witness_checkorder+0x81e
> _sx_slock() at _sx_slock+0x55
> sctp_init_ifns_for_vrf() at sctp_init_ifns_for_vrf+0x2e
> sctp_addr_change() at sctp_addr_change+0xce
> rt_newaddrmsg() at rt_newaddrmsg+0x54
> rtinit() at rtinit+0x358
> in_ifinit() at in_ifinit+0x2fd
> in_control() at in_control+0x1047
> ifioctl() at ifioctl+0xfc1
> kern_ioctl() at kern_ioctl+0xc5
> ioctl() at ioctl+0xfd
> syscall() at syscall+0x1af
> Xfast_syscall() at Xfast_syscall+0xe1
> --- syscall (54, FreeBSD ELF64, ioctl), rip = 0x800b8072c, rsp =  
> 0x7fffffffe4e8, rbp = 0x7fffffffef6a ---
>
>
> -Ben Kaduk
>
>
Received on Wed Oct 28 2009 - 05:37:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:57 UTC