linux/net/ax25
Jarek Poplawski 1105b5d1d4 [AX25] af_ax25: remove sock lock in ax25_info_show()
This lockdep warning:

> =======================================================
> [ INFO: possible circular locking dependency detected ]
> 2.6.24 #3
> -------------------------------------------------------
> swapper/0 is trying to acquire lock:
>  (ax25_list_lock){-+..}, at: [<f91dd3b1>] ax25_destroy_socket+0x171/0x1f0 [ax25]
>
> but task is already holding lock:
>  (slock-AF_AX25){-+..}, at: [<f91dbabc>] ax25_std_heartbeat_expiry+0x1c/0xe0 [ax25]
>
> which lock already depends on the new lock.
...

shows that ax25_list_lock and slock-AF_AX25 are taken in different
order: ax25_info_show() takes slock (bh_lock_sock(ax25->sk)) while
ax25_list_lock is held, so reversely to other functions. To fix this
the sock lock should be moved to ax25_info_start(), and there would
be still problem with breaking ax25_list_lock (it seems this "proper"
order isn't optimal yet). But, since it's only for reading proc info
it seems this is not necessary (e.g.  ax25_send_to_raw() does similar
reading without this lock too).

So, this patch removes sock lock to avoid deadlock possibility; there
is also used sock_i_ino() function, which reads sk_socket under proper
read lock. Additionally printf format of this i_ino is changed to %lu.

Reported-by: Bernard Pidoux F6BVP <f6bvp@free.fr>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-12 17:53:31 -08: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
TODO Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
af_ax25.c [AX25] af_ax25: remove sock lock in ax25_info_show() 2008-02-12 17:53:31 -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 [AX25]: sparse cleanups 2008-01-28 15:02:03 -08: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 [AX25]: sparse cleanups 2008-01-28 15:02:03 -08: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 [AX25]: sparse cleanups 2008-01-28 15:02:03 -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 [AX25]: sparse cleanups 2008-01-28 15:02:03 -08:00
sysctl_net_ax25.c [AX25]: Switch to using ctl_paths. 2008-01-28 15:01:09 -08:00