1
0
Fork 0
remarkable-linux/net/rfkill
Johannes Berg 5abd25f01c rfkill: fix rfkill_fop_read wait_event usage
[ Upstream commit 6736fde967 ]

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.

Cc: stable@vger.kernel.org
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: Sasha Levin <sasha.levin@oracle.com>
2016-02-15 15:45:28 -05: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
core.c rfkill: fix rfkill_fop_read wait_event usage 2016-02-15 15:45:28 -05:00
input.c rfkill: don't use [delayed_]work_pending() 2012-12-28 13:40:16 -08:00
rfkill-gpio.c Last round of updates for net-next: 2015-02-04 14:57:45 -08:00
rfkill-regulator.c net: rfkill: drop owner assignment from platform_drivers 2014-10-20 16:21:58 +02:00
rfkill.h rfkill: rewrite 2009-06-03 14:06:13 -04:00