NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/43294: locking against myself in ioctl setting up a gre interface



>Number:         43294
>Category:       kern
>Synopsis:       locking against myself in ioctl setting up a gre interface
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 12 09:50:01 +0000 2010
>Originator:     Martin Husemann
>Release:        NetBSD 5.99.29
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD nelly.aprisoft.de 5.99.29 NetBSD 5.99.29 (NELLY.MP) #127: Mon 
May 10 14:49:18 CEST 2010 
martin%emmas.aprisoft.de@localhost:/nelly/usr/src/sys/arch/sparc64/compile/NELLY.MP
 sparc64
Architecture: sparc64
Machine: sparc64
>Description:

On a LOCKDEBUG kernel run the following command (ip numbers are arbitrary):

ifconfig gre0 create
ifconfig gre0 tunnel 10.1.1.1 10.1.2.1
ifconfig gre0 192.168.170.1/30

Watch a LOCKDEBUG panic:

Mutex error: lockdebug_wantlock: locking against myself
                                                       
lock address : 0x000000000d209f40 type     :     sleep/adaptive
initialized  : 0x0000000001276be4                              
shared holds :                  0 exclusive:                  1
shares wanted:                  0 exclusive:                  1
current cpu  :                  1 last held:                  1
current lwp  : 0x000000000e6337e0 last held: 0x000000000e6337e0
last locked  : 0x00000000011ea884 unlocked : 0x00000000011ea300
owner field  : 0x000000000e6337e0 wait/spin:                0/0
                                                               
Turnstile chain at 0x18b96d0.
=> No active turnstile for this lock.
                                     
panic: LOCKDEBUG
Stopped in pid 34.1 (ifconfig) at       netbsd:cpu_Debugger+0x4:        nop
db{1}> bt                                                                  
lockdebug_abort1(18d4220, 7, 17022e0, 174cb20, 1, 44732c8) at netbsd:lockdebug_a
bort1+0x7c                                                                     
mutex_enter(d209f40, eb972e8, e, 18da000, 2, 3) at netbsd:mutex_enter+0x204
sosetlock(44d7b10, 18432d8, 564, 177bc00, 2, 3) at netbsd:sosetlock+0x58   
rip_usrreq(38, 0, 2f, 0, e6337e0, e6337e0) at netbsd:rip_usrreq+0x12c   
rip_usrreq_wrapper(44d7b10, 0, 0, 2f, 0, e6337e0) at netbsd:rip_usrreq_wrapper+0
x20                                                                            
socreate(15f5fc8, e6cb2d0, 3, 2f, e6337e0, 0) at netbsd:socreate+0x11c
fsocreate(2, 0, 3, 2f, e6337e0, e6cb5cc) at netbsd:fsocreate+0x64     
gre_ioctl(0, c0706984, 4473200, 7, 0, 44732a8) at netbsd:gre_ioctl+0x718
in_ifinit(4475000, 4473200, 0, 0, 0, 44732c8) at netbsd:in_ifinit+0x100 
in_control(37, 8040691a, e6cbc80, 4475000, 1, e6337e0) at netbsd:in_control+0xbc
0                                                                              
udp_usrreq_wrapper(3ff3d40, b, 8040691a, e6cbc80, 4475000, e6337e0) at netbsd:ud
p_usrreq_wrapper+0x20                                                          
compat_ifioctl(3ff3d40, 8040691a, 8040691a, e6cbc80, e6337e0, badcafe) at netbsd
:compat_ifioctl+0xfc                                                           
ifioctl(2d, 8040691a, e6cbc80, e6337e0, 18b6800, e6337e0) at netbsd:ifioctl+0x1c
c                                                                              
soo_ioctl(3ff3d40, 8040691a, e6cbc80, e6c8000, 100a600, 308) at netbsd:soo_ioctl
+0x2dc                                                                         
sys_ioctl(0, e6cbdc0, e6cbe00, badcafe, badcafe, badcafe) at netbsd:sys_ioctl+0x
bc                                                                             
syscall_plain(e6cbed0, e6cbf58, 40943488, 0, 40943488, 800) at netbsd:syscall_pl
ain+0x14c                                                                      
..

Last locked field points to in_control+0xae4


>How-To-Repeat:
see above

>Fix:
pass a "already locked" flag?

>Unformatted:
 Applies to NetBSD 5.1RC1 as well, fix needs urgent pullup!


Home | Main Index | Thread Index | Old Index