linux/net
Johannes Berg 61f0fc48ee 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: Luis Henriques <luis.henriques@canonical.com>
History 2016-02-25 00:18:36 +00:00
..
9p 9p: forgetting to cancel request on interrupted zero-copy RPC 2015-07-15 10:01:13 +01:00
802 neigh: use NEIGH_VAR_INIT in ndo_neigh_setup functions. 2014-01-16 11:31:58 -08:00
8021q net: Always untag vlan-tagged traffic on input. 2014-10-15 12:05:26 +02:00
appletalk appletalk: Fix socket referencing in skb 2014-07-08 19:39:43 -07:00
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-06-12 14:27:40 -07:00
ax25 net: add validation for the socket syscall protocol argument 2016-01-04 17:20:45 +00:00
batman-adv batman-adv: Drop immediate orig_node free function 2016-02-03 00:02:01 +00:00
bluetooth bluetooth: Validate socket address length in sco_sock_bind(). 2016-01-04 17:20:47 +00:00
bridge bridge: fix lockdep addr_list_lock false positive splat 2016-02-02 23:47:24 +00:00
caif unix/caif: sk_socket can disappear when state is unlocked 2015-06-12 13:30:18 +01:00
can can: add missing initialisations in CAN related skbuffs 2015-03-23 15:16:47 +00:00
ceph crush: fix a bug in tree bucket decode 2015-07-15 10:01:02 +01:00
core net: bpf: reject invalid shifts 2016-01-28 11:01:06 +00:00
dcb net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-04-24 13:44:54 -04:00
dccp ipv6: add complete rcu protection around np->opt 2015-12-18 16:06:24 +00:00
decnet net: add validation for the socket syscall protocol argument 2016-01-04 17:20:45 +00:00
dns_resolver dns_resolver: Null-terminate the right string 2014-07-20 22:33:32 -07:00
dsa net: dsa: Fix off-by-one in switch address parsing 2015-08-10 17:10:19 +01:00
ethernet net: eth_type_trans() should use skb_header_pointer() 2014-01-16 15:30:31 -08:00
hsr hsr: replace del_timer by del_timer_sync 2014-03-27 15:28:06 -04:00
ieee802154 ieee802154: Fix sockaddr_ieee802154 implicit padding information leak. 2015-07-15 10:00:19 +01:00
ipv4 xfrm: dst_entries_init() per-net dst_ops 2016-01-28 11:57:51 +00:00
ipv6 ipv6: tcp: add rcu locking in tcp_v6_send_synack() 2016-02-02 19:52:46 +00:00
ipx ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg 2014-12-01 10:02:10 +00:00
irda net: add validation for the socket syscall protocol argument 2016-01-04 17:20:45 +00:00
iucv af_iucv: correct cleanup if listen backlog is full 2014-05-30 17:35:23 -07:00
key net: Fix RCU splat in af_key 2015-09-03 13:30:00 +01:00
l2tp ipv6: add complete rcu protection around np->opt 2015-12-18 16:06:24 +00:00
lapb net/lapb: re-send packets on timeout 2013-09-23 16:52:45 -04:00
llc net: llc: use correct size for sysctl timeout entries 2015-03-02 15:04:42 +00:00
mac80211 mac80211: Requeue work after scan complete for all VIF types. 2016-02-25 00:18:36 +00:00
mac802154 mac802154: don't deliver packets to devices that are down 2014-06-11 12:10:19 -07:00
mpls net: gso: use feature flag argument in all protocol gso handlers 2015-08-27 14:27:14 +01:00
netfilter netfilter: nf_tables: fix bogus warning in nft_data_uninit() 2015-12-18 16:06:40 +00:00
netlabel netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlink netlink: Trim skb to alloc size to avoid MSG_TRUNC 2015-10-28 10:33:21 +00:00
netrom net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
nfc net: add __pskb_copy_fclone and pskb_copy_for_clone 2014-06-11 15:38:02 -07:00
openvswitch ovs: do not allocate memory from offline numa node 2015-10-28 10:33:20 +00:00
packet packet: infer protocol from ethernet header if unset 2015-12-18 16:06:18 +00:00
phonet phonet: properly unshare skbs in phonet_rcv() 2016-01-28 10:51:50 +00:00
rds RDS: fix race condition when sending a message on unbound socket 2016-01-04 17:20:35 +00:00
rfkill rfkill: fix rfkill_fop_read wait_event usage 2016-02-25 00:18:36 +00:00
rose NET: ROSE: Don't dereference NULL neighbour pointer. 2015-07-15 10:00:49 +01:00
rxrpc rxrpc: bogus MSG_PEEK test in rxrpc_recvmsg() 2015-03-24 10:31:10 +00:00
sched act_pedit: check binding before calling tcf_hash_release() 2015-08-25 10:13:55 +01:00
sctp sctp: start t5 timer only when peer rwnd is 0 and local state is SHUTDOWN_PENDING 2016-01-28 11:57:53 +00:00
sunrpc SUNRPC: Fix callback channel 2016-01-11 10:50:19 +00:00
tipc net/tipc: initialize security state for new connection socket 2015-08-27 13:31:56 +01:00
unix unix: properly account for FDs passed over unix sockets 2016-01-28 10:23:38 +00:00
vmw_vsock vsock: Make transport the proto owner 2014-05-05 13:13:50 -04:00
wimax wimax: remove dead code 2013-11-21 13:09:42 -05:00
wireless cfg80211: ignore netif running state when changing iftype 2015-07-15 10:01:22 +01:00
x25 net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
xfrm xfrm: dst_entries_init() per-net dst_ops 2016-01-28 11:57:51 +00:00
compat.c net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() behaviour 2015-03-24 10:48:46 +00:00
Kconfig Merge branch 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2014-04-03 13:05:42 -07:00
Makefile net: move 6lowpan compression code to separate module 2014-01-15 15:36:38 -08:00
nonet.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
socket.c net: socket: Fix the wrong returns for recvmsg and sendmsg 2015-06-02 11:10:03 +01:00
sysctl_net.c net: Update the sysctl permissions handler to test effective uid/gid 2013-10-07 15:57:56 -04:00