linux/include/net
Gustavo F. Padovan e454c84464 Bluetooth: Fix deadlock in the ERTM logic
The Enhanced Retransmission Mode(ERTM) is a realiable mode of operation
of the Bluetooth L2CAP layer. Think on it like a simplified version of
TCP.
The problem we were facing here was a deadlock. ERTM uses a backlog
queue to queue incomimg packets while the user is helding the lock. At
some moment the sk_sndbuf can be exceeded and we can't alloc new skbs
then the code sleep with the lock to wait for memory, that stalls the
ERTM connection once we can't read the acknowledgements packets in the
backlog queue to free memory and make the allocation of outcoming skb
successful.

This patch actually affect all users of bt_skb_send_alloc(), i.e., all
L2CAP modes and SCO.

We are safe against socket states changes or channels deletion while the
we are sleeping wait memory. Checking for the sk->sk_err and
sk->sk_shutdown make the code safe, since any action that can leave the
socket or the channel in a not usable state set one of the struct
members at least. Then we can check both of them when getting the lock
again and return with the proper error if something unexpected happens.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Ulisses Furquim <ulisses@profusion.mobi>
2010-09-30 12:19:35 -03:00
..
9p net/9p: Implement TXATTRCREATE 9p call 2010-08-02 14:28:34 -05:00
bluetooth Bluetooth: Fix deadlock in the ERTM logic 2010-09-30 12:19:35 -03:00
caif caif-driver: Add CAIF-SPI Protocol driver. 2010-06-29 00:08:21 -07:00
irda irda: Use __packed annotation instead IRDA_PACKED macro 2010-07-21 14:44:29 -07:00
iucv include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
netfilter netfilter: nf_nat: make unique_tuple return void 2010-08-02 17:20:54 +02:00
netns ipv6: ip6mr: support multiple tables 2010-05-11 14:40:55 +02:00
phonet phonet: use call_rcu for phonet device free 2010-06-09 16:14:25 -07:00
sctp net: use __packed annotation 2010-06-03 03:21:52 -07:00
tc_act net sched: fix race in mirred device removal 2010-07-24 21:04:20 -07:00
tipc tipc: Update commenting in TIPC API 2010-05-12 23:02:23 -07:00
act_api.h pkt_sched: gen_kill_estimator() rcu fixes 2010-06-11 18:37:08 -07:00
addrconf.h ipv6: add a missing unregister_pernet_subsys call 2010-09-26 19:09:25 -07:00
af_ieee802154.h
af_rxrpc.h
af_unix.h af_unix: Allow credentials to work across user and pid namespaces. 2010-06-16 14:58:16 -07:00
ah.h
arp.h
atmclip.h
ax25.h include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ax88796.h
cfg80211.h cfg80211: fix dev <-> wiphy typo 2010-07-29 12:55:00 -04:00
checksum.h
cipso_ipv4.h
cls_cgroup.h cls_cgroup: Fix rcu lockdep warning 2010-09-03 09:55:24 -07:00
compat.h net: fix compat_sys_recvmmsg parameter type 2009-12-11 15:07:56 -08:00
datalink.h
dcbnl.h
dn.h
dn_dev.h net: use __packed annotation 2010-06-03 03:21:52 -07:00
dn_fib.h decnet: Remove unused FIB metric macros. 2010-03-27 19:23:46 -07:00
dn_neigh.h
dn_nsp.h net: use __packed annotation 2010-06-03 03:21:52 -07:00
dn_route.h net-next: remove useless union keyword 2010-06-10 23:31:35 -07:00
dsa.h
dsfield.h
dst.h net: reset skb queue mapping when rx'ing over tunnel 2010-09-26 18:48:40 -07:00
dst_ops.h
esp.h
ethoc.h
fib_rules.h net: fib_rules: mark arguments to fib_rules_register const and __net_initdata 2010-04-26 16:02:04 +02:00
flow.h flow: virtualize flow cache entry methods 2010-04-07 03:43:18 -07:00
garp.h
gen_stats.h
genetlink.h net: CONFIG_NET_NS reduction 2010-06-02 05:16:23 -07:00
icmp.h ipv4: raw: move struct raw_sock and raw_sk() to include/net/raw.h 2010-04-13 14:49:31 -07:00
ieee80211_radiotap.h wireless: update radiotap parser 2010-02-08 16:50:53 -05:00
ieee802154.h
ieee802154_netdev.h
if_inet6.h ipv6: Replace inet6_ifaddr->dead with state 2010-05-18 15:36:06 -07:00
inet6_connection_sock.h net: replace ipfragok with skb->local_df 2010-04-15 23:36:37 -07:00
inet6_hashtables.h tcp: Fix a connect() race with timewait sockets 2009-12-08 20:17:51 -08:00
inet_common.h inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage() 2010-07-12 20:21:46 -07:00
inet_connection_sock.h net: replace ipfragok with skb->local_df 2010-04-15 23:36:37 -07:00
inet_ecn.h
inet_frag.h fragment: add fast path for in-order fragments 2010-06-30 13:44:29 -07:00
inet_hashtables.h tcp: Fix a connect() race with timewait sockets 2009-12-08 20:17:51 -08:00
inet_sock.h net - IP_NODEFRAG option for IPv4 socket 2010-06-23 13:16:38 -07:00
inet_timewait_sock.h net: suppress RCU lockdep false positive in twsk_net() 2010-04-27 12:39:01 -07:00
inetpeer.h inetpeer: restore small inet_peer structures 2010-06-16 11:55:39 -07:00
ip.h snmp: 64bit ipstats_mib for all arches 2010-06-30 13:31:19 -07:00
ip6_checksum.h
ip6_fib.h net-next: remove useless union keyword 2010-06-10 23:31:35 -07:00
ip6_route.h net: sk_dst_cache RCUification 2010-04-13 01:41:33 -07:00
ip6_tunnel.h net: use __packed annotation 2010-06-03 03:21:52 -07:00
ip_fib.h
ip_vs.h ipvs: fix active FTP 2010-09-08 10:39:57 -07:00
ipcomp.h percpu: add __percpu sparse annotations to net 2010-02-16 23:05:38 -08:00
ipconfig.h
ipip.h net-next: remove useless union keyword 2010-06-10 23:31:35 -07:00
ipv6.h snmp: 64bit ipstats_mib for all arches 2010-06-30 13:31:19 -07:00
ipx.h net: use __packed annotation 2010-06-03 03:21:52 -07:00
iw_handler.h include/net/iw_handler.h: Use SIOCIWFIRST not SIOCSIWCOMMIT in comment 2010-03-31 14:49:12 -04:00
lapb.h
lib80211.h lib80211: remove unused host_build_iv option 2010-07-26 15:09:04 -04:00
llc.h llc: convert llc_sap_list to RCU 2009-12-26 20:46:28 -08:00
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h llc: use a device based hash table to speed up multicast delivery 2009-12-26 20:43:57 -08:00
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
mac80211.h Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem 2010-07-29 14:47:07 -04:00
mip6.h net: use __packed annotation 2010-06-03 03:21:52 -07:00
mld.h ipv6 mcast: Introduce include/net/mld.h for MLD definitions. 2010-04-23 13:35:55 +09:00
ndisc.h net: use __packed annotation 2010-06-03 03:21:52 -07:00
neighbour.h net/neighbour.h: fix typo 2010-06-30 12:06:52 -07:00
net_namespace.h nsproxy: remove INIT_NSPROXY() 2010-03-12 15:52:40 -08:00
netdma.h
netevent.h
netlabel.h include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
netlink.h net: Fix a typo in netlink.h 2010-06-23 12:58:40 -07:00
netrom.h include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
nexthop.h
nl802154.h
p8022.h
pkt_cls.h
pkt_sched.h net: Define accessors to manipulate QDISC_STATE_RUNNING 2010-06-02 03:23:51 -07:00
protocol.h
psnap.h
raw.h ipv4: ipmr: support multiple tables 2010-04-13 14:49:34 -07:00
rawv6.h
red.h
regulatory.h wireless: only use alpha2 regulatory information from country IE 2010-07-20 16:44:35 -04:00
request_sock.h tcp: account SYN-ACK timeouts & retransmissions 2010-01-17 19:09:39 -08:00
rose.h
route.h tproxy: check for transparent flag in ip_route_newports 2010-09-27 15:03:33 -07:00
rtnetlink.h rtnetlink: support specifying device flags on device creation 2010-02-27 02:43:40 -08:00
sch_generic.h Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-07-07 15:59:38 -07:00
scm.h scm: Capture the full credentials of the scm sender. 2010-06-16 14:55:56 -07:00
slhc_vj.h
snmp.h snmp: 64bit ipstats_mib for all arches 2010-06-30 13:31:19 -07:00
sock.h udp: add rehash on connect() 2010-09-08 21:45:01 -07:00
stp.h
tcp.h tcp: Prevent overzealous packetization by SWS logic. 2010-09-15 12:01:44 -07:00
tcp_states.h
timewait_sock.h
transp_v6.h IPv6: Add dontfrag argument to relevant functions 2010-04-23 23:35:28 -07:00
udp.h udp: add rehash on connect() 2010-09-08 21:45:01 -07:00
udplite.h
wext.h
wimax.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
wpan-phy.h
x25.h X25: Move accept approve flag to bitfield 2010-05-17 17:39:27 -07:00
x25device.h X25: Add if_x25.h and x25 to device identifiers 2010-04-22 16:12:36 -07:00
xfrm.h xfrm: Allow different selector family in temporary state 2010-09-20 11:11:38 -07:00