[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230217125105.12385-1-alsp705@gmail.com>
Date: Fri, 17 Feb 2023 15:51:05 +0300
From: Alexander Sapozhnikov <alsp705@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Alexander Sapozhnikov <alsp705@...il.com>,
Uladzislau Rezki <urezki@...il.com>,
Christoph Hellwig <hch@...radead.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: [PATCH] mm/vmalloc: fix unsafe dereference of potential null ptr in vmalloc_init()
Return value of a function 'kmem_cache_create' is dereferenced
at vmalloc.c:2444 without checking for null, but it is usually
checked for this function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexander Sapozhnikov <alsp705@...il.com>
---
mm/vmalloc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ca71de7c9d77..ed75dfd44b85 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2426,6 +2426,8 @@ void __init vmalloc_init(void)
* Create the cache for vmap_area objects.
*/
vmap_area_cachep = KMEM_CACHE(vmap_area, SLAB_PANIC);
+ if (!vmap_area_cachep)
+ return;
for_each_possible_cpu(i) {
struct vmap_block_queue *vbq;
--
2.34.1
Powered by blists - more mailing lists