btsocks_rfcomm_session_mtx / so_snd_sx LOR

Maksim Yevmenkin maksim.yevmenkin at gmail.com
Wed Jun 20 21:29:55 UTC 2007


please try the attached patch

thanks,
max

On 6/16/07, Lars Engels <lars.engels at 0x20.net> wrote:
> On a ~10 days old CURRENT I get this LOR:
>
> lock order reversal: (sleepable after non-sleepable)
>  1st 0xc4de5120 btsocks_rfcomm_session_mtx (btsocks_rfcomm_session_mtx)
> @
> /usr/src/sys/modules/netgraph/bluetooth/socket/../../../../netgraph/bluetooth/socket/ng_btsocket_rfcomm.c:995
>  2nd 0xc4b60118 so_snd_sx (so_snd_sx) @
> /usr/src/sys/kern/uipc_sockbuf.c:145
> KDB: stack backtrace:
> db_trace_self_wrapper(c07e20d4,e2502b68,c05d64aa,c07e4585,c4b60118,...)
> at db_trace_self_wrapper+0x26
> kdb_backtrace(c07e4585,c4b60118,c07e7d16,c07e7d16,c07e7992,...) at
> kdb_backtrace+0x29
> witness_checkorder(c4b60118,9,c07e7992,91,ff,...) at
> witness_checkorder+0x6af
> _sx_xlock(c4b60118,40,c07e7992,91,e2502c00,...) at _sx_xlock+0x77
> sblock(c4b600dc,2,c05d5db2,c08d0288,c08d0288,...) at sblock+0x65
> sosend_generic(c4b60000,0,0,c46b0e00,0,...) at sosend_generic+0xcb
> sosend(c4b60000,0,0,c46b0e00,0,...) at sosend+0x54
> ng_btsocket_rfcomm_sessions_task(0,1,c07e32ed,52,c3b3b89c,...) at
> ng_btsocket_rfcomm_sessions_task+0x3c6
> taskqueue_run(c3b3b880,e2502cfc,c0587575,0,0,...) at taskqueue_run+0x108
> taskqueue_swi_giant_run(0,0,c07dc1d7,40b,c3b3b864,...) at
> taskqueue_swi_giant_run+0x13
> ithread_loop(c3ba1bc0,e2502d38,0,0,c3ba5c1c,...) at ithread_loop+0x1aa
> fork_exit(c05873cb,c3ba1bc0,e2502d38) at fork_exit+0x51
> fork_trampoline() at fork_trampoline+0x8
> --- trap 0, eip = 0, esp = 0xe2502d70, ebp = 0 ---
>
>
>
>
> --
> Lars Engels
> E-Mail: lars.engels at 0x20.net
>
>
-------------- next part --------------
--- ng_btsocket_rfcomm.c.orig	2007-06-20 14:18:46.000000000 -0700
+++ ng_btsocket_rfcomm.c	2007-06-20 14:20:42.000000000 -0700
@@ -1606,8 +1606,8 @@
 			return (0); /* we are done */
 
 		/* Call send function on the L2CAP socket */
-		error = sosend(s->l2so, NULL, NULL, m, NULL, 0,
-		    curthread /* XXX */);
+		error = (*s->l2so->so_proto->pr_usrreqs->pru_send)(s->l2so,
+				0, m, NULL, NULL, curthread /* XXX */);
 		if (error != 0) {
 			NG_BTSOCKET_RFCOMM_ERR(
 "%s: Could not send data to L2CAP socket, error=%d\n", __func__, error);


More information about the freebsd-current mailing list