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
netfilter netfilter: nf_nat: make unique_tuple return void 2010-08-02 17:20:54 +02:00
netns
phonet
sctp
tc_act net sched: fix race in mirred device removal 2010-07-24 21:04:20 -07:00
tipc
act_api.h
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
ah.h
arp.h
atmclip.h
ax25.h
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
datalink.h
dcbnl.h
dn.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h
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
flow.h
garp.h
gen_stats.h
genetlink.h
icmp.h
ieee80211_radiotap.h
ieee802154.h
ieee802154_netdev.h
if_inet6.h
inet6_connection_sock.h
inet6_hashtables.h
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
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
inet_sock.h net - IP_NODEFRAG option for IPv4 socket 2010-06-23 13:16:38 -07:00
inet_timewait_sock.h
inetpeer.h
ip.h snmp: 64bit ipstats_mib for all arches 2010-06-30 13:31:19 -07:00
ip6_checksum.h
ip6_fib.h
ip6_route.h
ip6_tunnel.h
ip_fib.h
ip_vs.h ipvs: fix active FTP 2010-09-08 10:39:57 -07:00
ipcomp.h
ipconfig.h
ipip.h
ipv6.h snmp: 64bit ipstats_mib for all arches 2010-06-30 13:31:19 -07:00
ipx.h
iw_handler.h
lapb.h
lib80211.h lib80211: remove unused host_build_iv option 2010-07-26 15:09:04 -04:00
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
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
mld.h
ndisc.h
neighbour.h net/neighbour.h: fix typo 2010-06-30 12:06:52 -07:00
net_namespace.h
netdma.h
netevent.h
netlabel.h
netlink.h net: Fix a typo in netlink.h 2010-06-23 12:58:40 -07:00
netrom.h
nexthop.h
nl802154.h
p8022.h
pkt_cls.h
pkt_sched.h
protocol.h
psnap.h
raw.h
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
rose.h
route.h tproxy: check for transparent flag in ip_route_newports 2010-09-27 15:03:33 -07:00
rtnetlink.h
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
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
udp.h udp: add rehash on connect() 2010-09-08 21:45:01 -07:00
udplite.h
wext.h
wimax.h
wpan-phy.h
x25.h
x25device.h
xfrm.h xfrm: Allow different selector family in temporary state 2010-09-20 11:11:38 -07:00