device_cgroup: Fix RCU list debugging warning
authorAmol Grover <frextrite@gmail.com>
Mon, 6 Apr 2020 10:59:50 +0000 (16:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:23 +0000 (17:36 +0200)
commit0b2f403ff302a81feee54e30762601646bc2caea
treebc8861665b99401250d29b6c2cb1bb37b9c0dd3b
parent0c52d2a4d9e9c5659feb05f718bb37d3eab6f591
device_cgroup: Fix RCU list debugging warning

[ Upstream commit bc62d68e2a0a69fcdcf28aca8edb01abf306b698 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/device_cgroup.c