mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: mm/slub: Fix Kasan issue with for_each_object_track
In for_each_object_track we go through meta data of the slab object in function(fn), and as a result false postive out-of-bound access is reported by kasan. Fix this by wrapping that function call with metadata_access_enable/disable. Bug: 222651868 Fixes:ee8d2c7884("ANDROID: mm: add get_each_object_track function") Change-Id: Ifb4241a9c3e397a52759d467aa267d1297e297dd Signed-off-by: Vijayanand Jitta <quic_vjitta@quicinc.com> (cherry picked from commitcd6e5d5d7d)
This commit is contained in:
committed by
Suren Baghdasaryan
parent
ec0a6ef36e
commit
0e00d7c46b
@@ -705,7 +705,9 @@ unsigned long get_each_object_track(struct kmem_cache *s,
|
||||
slab_lock(page, &flags);
|
||||
for_each_object(p, s, page_address(page), page->objects) {
|
||||
t = get_track(s, p, alloc);
|
||||
metadata_access_enable();
|
||||
ret = fn(s, p, t, private);
|
||||
metadata_access_disable();
|
||||
if (ret < 0)
|
||||
break;
|
||||
num_track += 1;
|
||||
|
||||
Reference in New Issue
Block a user