linux/net/rfkill
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
..
core.c rfkill: fix rfkill_fop_read wait_event usage 2016-02-25 00:18:36 +00:00
input.c rfkill: don't use [delayed_]work_pending() 2012-12-28 13:40:16 -08:00
Kconfig net: rfkill: gpio: clean up clock handling 2013-10-28 15:05:24 +01:00
Makefile net: rfkill: add generic gpio rfkill driver 2011-05-19 13:53:54 -04:00
rfkill-gpio.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2014-05-22 13:58:36 -04:00
rfkill-regulator.c net: rfkill: Do not ignore errors from regulator_enable() 2013-08-15 18:17:05 +02:00
rfkill.h rfkill: rewrite 2009-06-03 14:06:13 -04:00