Skip to content

Commit bc62d68

Browse files
frextriteJames Morris
authored and
James Morris
committed
device_cgroup: Fix RCU list debugging warning
exceptions may be traversed using list_for_each_entry_rcu() outside of an RCU read side critical section BUT under the protection of decgroup_mutex. Hence add the corresponding lockdep expression to fix the following false-positive warning: [ 2.304417] ============================= [ 2.304418] WARNING: suspicious RCU usage [ 2.304420] 5.5.4-stable #17 Tainted: G E [ 2.304422] ----------------------------- [ 2.304424] security/device_cgroup.c:355 RCU-list traversed in non-reader section!! Signed-off-by: Amol Grover <frextrite@gmail.com> Signed-off-by: James Morris <jmorris@namei.org>
1 parent bcf8768 commit bc62d68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security/device_cgroup.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ static bool match_exception_partial(struct list_head *exceptions, short type,
354354
{
355355
struct dev_exception_item *ex;
356356

357-
list_for_each_entry_rcu(ex, exceptions, list) {
357+
list_for_each_entry_rcu(ex, exceptions, list,
358+
lockdep_is_held(&devcgroup_mutex)) {
358359
if ((type & DEVCG_DEV_BLOCK) && !(ex->type & DEVCG_DEV_BLOCK))
359360
continue;
360361
if ((type & DEVCG_DEV_CHAR) && !(ex->type & DEVCG_DEV_CHAR))

0 commit comments

Comments
 (0)