Repository navigation
Commit 6736fde
committed
rfkill: fix rfkill_fop_read wait_event usage
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: c64fb01 ("rfkill: create useful userspace interface")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>1 parent 4fa11ec commit 6736fde
1 file changed
Lines changed: 4 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | 1098 | | |
1110 | 1099 | | |
1111 | 1100 | | |
| |||
1122 | 1111 | | |
1123 | 1112 | | |
1124 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1125 | 1117 | | |
1126 | | - | |
| 1118 | + | |
1127 | 1119 | | |
1128 | 1120 | | |
1129 | 1121 | | |
| |||
0 commit comments