ANDROID: kasan: fix slab page check in complete_report_info
The backport commit77a0deb5d5("BACKPORT: kasan: fill in cache and object in complete_report_info") did not resolve the conflict due to the folio patchset missing in 5.15 correctly: complete_report_info needs to check PageSlab to make sure that the page is a slab page. Add a PageSlab check to complete_report_info. Bug: 254721825 Reported-by: Peter Collingbourne <pcc@google.com> Fixes:77a0deb5d5("BACKPORT: kasan: fill in cache and object in complete_report_info") Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Change-Id: I307ddbd9315134f825b37a0c7254a033453a46ef
This commit is contained in:
@@ -407,7 +407,7 @@ static void complete_report_info(struct kasan_report_info *info)
|
||||
info->first_bad_addr = addr;
|
||||
|
||||
page = kasan_addr_to_page(addr);
|
||||
if (page && page->slab_cache) {
|
||||
if (page && PageSlab(page) && page->slab_cache) {
|
||||
info->cache = page->slab_cache;
|
||||
info->object = nearest_obj(info->cache, page, addr);
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user