android_kernel_xiaomi_sm8350/net
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
..
9p 9p: transport API reorganization 2008-02-06 19:25:03 -06:00
802
8021q
appletalk
atm
ax25 [AX25] af_ax25: remove sock lock in ax25_info_show() 2008-02-12 17:53:31 -08:00
bluetooth bluetooth rfcomm tty: destroy before tty_close() 2008-02-05 03:12:06 -08:00
bridge
can [CAN]: Minor clean-ups 2008-02-07 18:05:04 -08:00
core [IPSEC] flow: reorder "struct flow_cache_entry" and remove SLAB_HWCACHE_ALIGN 2008-02-07 23:30:42 -08:00
dccp
decnet [DECNET] ROUTE: remove unecessary alignment 2008-02-07 23:29:57 -08:00
econet
ethernet
ieee80211
ipv4 fib_trie: /proc/net/route performance improvement 2008-02-12 17:53:31 -08:00
ipv6 [IPV6]: Replace using the magic constant "1024" with IP6_RT_PRIO_USER for fc_metric. 2008-02-09 23:43:11 -08:00
ipx
irda
iucv [AF_IUCV]: defensive programming of iucv_callback_txdone 2008-02-07 18:07:44 -08:00
key [KEY]: Convert net/pfkey to use seq files. 2008-02-09 23:20:06 -08:00
lapb
llc
mac80211 mac80211: Is not EXPERIMENTAL anymore 2008-02-05 14:35:47 -05:00
netfilter [NETFILTER]: xt_iprange: add missing #include 2008-02-07 17:57:11 -08:00
netlabel NetLabel: introduce a new kernel configuration API for NetLabel 2008-02-05 09:44:20 -08:00
netlink
netrom
packet
rfkill
rose
rxrpc Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) 2008-02-07 08:42:26 -08:00
sched [PKT_SCHED] ematch: Fix build warning. 2008-02-10 03:48:15 -08:00
sctp [SCTP]: Convert sctp_dbg_objcnt to seq files. 2008-02-09 23:24:58 -08:00
sunrpc SUNPRC: Fix printk format warning 2008-02-10 18:11:22 -05:00
tipc [TIPC]: declare proto_ops structures as 'const'. 2008-02-07 18:18:01 -08:00
unix
wanrouter
wireless
x25
xfrm [IPSEC]: Add support for aes-ctr. 2008-02-07 23:11:56 -08:00
compat.c
Kconfig namespaces: mark NET_NS with "depends on NAMESPACES" 2008-02-08 09:22:23 -08:00
Makefile
nonet.c
socket.c
sysctl_net.c
TUNABLE