kernel-ark/net/ax25
Jarek Poplawski ecd2ebdea3 [AX25] af_ax25: Possible circular locking.
Bernard Pidoux F6BVP reported:
> When I killall kissattach I can see the following message.
>
> This happens on kernel 2.6.24-rc5 already patched with the 6 previously
> patches I sent recently.
>
>
> =======================================================
> [ INFO: possible circular locking dependency detected ]
> 2.6.23.9 #1
> -------------------------------------------------------
> kissattach/2906 is trying to acquire lock:
>  (linkfail_lock){-+..}, at: [<d8bd4603>] ax25_link_failed+0x11/0x39 [ax25]
>
> but task is already holding lock:
>  (ax25_list_lock){-+..}, at: [<d8bd7c7c>] ax25_device_event+0x38/0x84
> [ax25]
>
> which lock already depends on the new lock.
>
>
> the existing dependency chain (in reverse order) is:
...

lockdep is worried about the different order here:

#1 (rose_neigh_list_lock){-+..}:
#3 (ax25_list_lock){-+..}:

#0 (linkfail_lock){-+..}:
#1 (rose_neigh_list_lock){-+..}:

#3 (ax25_list_lock){-+..}:
#0 (linkfail_lock){-+..}:

So, ax25_list_lock could be taken before and after linkfail_lock. 
I don't know if this three-thread clutch is very probable (or
possible at all), but it seems another bug reported by Bernard
("[...] system impossible to reboot with linux-2.6.24-rc5")
could have similar source - namely ax25_list_lock held by
ax25_kill_by_device() during ax25_disconnect(). It looks like the
only place which calls ax25_disconnect() this way, so I guess, it
isn't necessary.

This patch is breaking the lock for ax25_disconnect().

Reported-and-tested-by: Bernard Pidoux <f6bvp@free.fr>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-10 21:21:20 -08:00
..
af_ax25.c [AX25] af_ax25: Possible circular locking. 2008-01-10 21:21:20 -08:00
ax25_addr.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ax25_dev.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ax25_ds_in.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
ax25_ds_subr.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
ax25_ds_timer.c [AX.25]: Optimize AX.25 socket list lock 2006-07-12 13:58:57 -07:00
ax25_iface.c [AX25]: don't free pointers to statically allocated data 2007-08-14 17:24:05 -07:00
ax25_in.c [NET]: Correct two mistaken skb_reset_mac_header() conversions. 2007-12-20 00:25:54 -08:00
ax25_ip.c [NET]: Move hardware header operations out of netdevice. 2007-10-10 16:52:52 -07:00
ax25_out.c [SK_BUFF]: Introduce skb_copy_from_linear_data{_offset} 2007-04-25 22:28:23 -07:00
ax25_route.c [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
ax25_std_in.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ax25_std_subr.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ax25_std_timer.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ax25_subr.c [AX25]: Locking dependencies fix in ax25_disconnect(). 2007-12-16 14:02:07 -08:00
ax25_timer.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ax25_uid.c [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
Kconfig [S390] Kconfig: unwanted menus for s390. 2007-05-10 15:46:07 +02:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sysctl_net_ax25.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
TODO Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00