diff options
author | Muchun Song <[email protected]> | 2024-07-18 16:36:07 +0800 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-08-07 18:33:56 -0700 |
commit | 5161b48712dcd08ec427c450399d4d1483e21dea (patch) | |
tree | a7d52661b6d7c484b9b1fd49f7cb779fc05be3a8 /tools/testing/selftests/bpf/progs/test_autoload.c | |
parent | 7d4df2dad312f270d62fecb0e5c8b086c6d7dcfc (diff) |
mm: list_lru: fix UAF for memory cgroup
The mem_cgroup_from_slab_obj() is supposed to be called under rcu lock or
cgroup_mutex or others which could prevent returned memcg from being
freed. Fix it by adding missing rcu read lock.
Found by code inspection.
[[email protected]: only grab rcu lock when necessary, per Vlastimil]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 0a97c01cd20b ("list_lru: allow explicit memcg and NUMA node selection")
Signed-off-by: Muchun Song <[email protected]>
Acked-by: Shakeel Butt <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Nhat Pham <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions