linux-stable/net
Johannes Berg 2048f19dd0 rfkill: fix rfkill_fop_read wait_event usage
commit 6736fde967 upstream.

The code within wait_event_interruptible() is called with
!TASK_RUNNING, so mustn't call any functions that can sleep,
like mutex_lock().

Since we re-check the list_empty() in a loop after the wait,
it's safe to simply use list_empty() without locking.

This bug has existed forever, but was only discovered now
because all userspace implementations, including the default
'rfkill' tool, use poll() or select() to get a readable fd
before attempting to read.

Fixes: c64fb01627 ("rfkill: create useful userspace interface")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2016-03-12 14:25:42 +01:00
..
9p net/9p: Fix the msize calculation. 2011-11-07 12:32:00 -08:00
802 net: remove COMPAT_NET_DEV_OPS 2009-05-25 01:53:53 -07:00
8021q vlan: Don't propagate flag changes on down interfaces. 2014-12-13 15:16:17 +01:00
appletalk appletalk: Fix socket referencing in skb 2014-11-23 10:55:38 +01:00
atm net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
ax25 net: add validation for the socket syscall protocol argument 2016-01-29 22:12:42 +01:00
bluetooth bluetooth: Validate socket address length in sco_sock_bind(). 2016-01-29 22:12:43 +01:00
bridge bridge: flush br's address entry in fdb when remove the bridge dev 2014-05-19 07:54:04 +02:00
can can: add missing socket check in can/raw release 2011-05-09 15:55:42 -07:00
core net, scm: fix PaX detected msg_controllen overflow in scm_detach_fds 2016-01-29 22:12:49 +01:00
dcb dcbnl: fix various netlink info leaks 2013-06-10 11:43:34 +02:00
dccp dccp: catch failed request_module call in dccp_probe init 2015-09-18 13:52:19 +02:00
decnet net: add validation for the socket syscall protocol argument 2016-01-29 22:12:42 +01:00
dsa netdev: convert pseudo-devices to netdev_tx_t 2009-09-01 01:13:07 -07:00
econet econet: fix CVE-2010-3848 2011-05-09 15:55:33 -07:00
ethernet net: remove COMPAT_NET_DEV_OPS 2009-05-25 01:53:53 -07:00
ieee802154 net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
ipv4 tcp: initialize tp->copied_seq in case of cross SYN connection 2016-01-29 22:12:49 +01:00
ipv6 ipv6/addrlabel: fix ip6addrlbl_get() 2016-01-29 22:12:57 +01:00
ipx net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
irda net: add validation for the socket syscall protocol argument 2016-01-29 22:12:42 +01:00
iucv net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
key net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
lapb net: remove NET_RX_BAD and NET_RX_CN* defines 2009-07-05 19:15:35 -07:00
llc net: llc: use correct size for sysctl timeout entries 2015-05-24 10:10:43 +02:00
mac80211 mac80211: fix fragmentation code, particularly for encryption 2014-12-13 15:16:16 +01:00
netfilter ipvs: uninitialized data with IP_VS_IPV6 2015-05-24 10:10:52 +02:00
netlabel Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-07-30 19:22:43 -07:00
netlink netlink: fix possible spoofing from non-root processes 2015-09-18 13:51:52 +02:00
netrom net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
packet net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
phonet inet: prevent leakage of uninitialized memory to user in recv syscalls 2014-05-19 07:53:59 +02:00
rds RDS: fix race condition when sending a message on unbound socket 2016-01-29 22:12:39 +01:00
rfkill rfkill: fix rfkill_fop_read wait_event usage 2016-03-12 14:25:42 +01:00
rose NET: ROSE: Don't dereference NULL neighbour pointer. 2015-09-18 13:52:13 +02:00
rxrpc Revert "net: add length argument to skb_copy_and_csum_datagram_iovec" 2016-01-29 22:12:40 +01:00
sched ematch: Fix auto-loading of ematch modules. 2015-05-24 10:10:46 +02:00
sctp sctp: translate network order to host order when users get a hmacid 2016-03-12 14:25:39 +01:00
sunrpc SUNRPC: xs_reset_transport must mark the connection as disconnected 2015-12-06 00:49:08 +01:00
tipc net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
unix af_unix: fix struct pid memory leak 2016-03-12 14:25:41 +01:00
wanrouter wanmain: comparing array with NULL 2012-10-07 23:38:10 +02:00
wimax wimax: fix warning caused by not checking retval of rfkill_set_hw_state() 2009-06-11 11:12:48 -07:00
wireless nl80211: fix MAC address validation 2011-12-09 09:21:40 -08:00
x25 net: rework recvmsg handler msg_name and msg_namelen logic 2014-05-19 07:54:00 +02:00
xfrm xfrm_user: return error pointer instead of NULL #2 2013-06-10 11:42:53 +02:00
compat.c net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() behaviour 2015-05-24 10:10:56 +02:00
Kconfig net/compat/wext: send different messages to compat tasks 2009-07-15 08:53:39 -07:00
Makefile net: remove redundant sched/ in net/Makefile 2009-07-12 20:11:14 -07:00
nonet.c
socket.c net: socket: Fix the wrong returns for recvmsg and sendmsg 2015-06-03 17:20:03 +02:00
sysctl_net.c net: sysctl_net - use net_eq to compare nets 2009-03-16 16:23:30 +01:00
TUNABLE