linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: slub: fix dereference invalid pointer in alloc_consistency_checks
@ 2025-07-25  2:48 Li Qiong
  2025-07-25  4:01 ` Harry Yoo
  2025-07-25  6:49 ` [PATCH v2] mm: slub: avoid deref of free pointer in sanity checks if object is invalid Li Qiong
  0 siblings, 2 replies; 16+ messages in thread
From: Li Qiong @ 2025-07-25  2:48 UTC (permalink / raw)
  To: Christoph Lameter, David Rientjes, Andrew Morton, Vlastimil Babka
  Cc: Roman Gushchin, Harry Yoo, linux-mm, linux-kernel, stable,
	Li Qiong

In object_err(), need dereference the 'object' pointer, it may cause
a invalid pointer fault. Use slab_err() instead.

Signed-off-by: Li Qiong <liqiong@nfschina.com>
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 31e11ef256f9..3a2e57e2e2d7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1587,7 +1587,7 @@ static inline int alloc_consistency_checks(struct kmem_cache *s,
 		return 0;
 
 	if (!check_valid_pointer(s, slab, object)) {
-		object_err(s, slab, object, "Freelist Pointer check fails");
+		slab_err(s, slab, "Freelist Pointer (0x%p) check fails", object);
 		return 0;
 	}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-07-28 13:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25  2:48 [PATCH] mm: slub: fix dereference invalid pointer in alloc_consistency_checks Li Qiong
2025-07-25  4:01 ` Harry Yoo
2025-07-25  5:46   ` liqiong
2025-07-25  6:49 ` [PATCH v2] mm: slub: avoid deref of free pointer in sanity checks if object is invalid Li Qiong
2025-07-25 16:47   ` Vlastimil Babka
2025-07-25 17:10     ` Matthew Wilcox
2025-07-25 19:22       ` Matthew Wilcox
2025-07-25 22:49         ` Harry Yoo
2025-07-25 19:55       ` Harry Yoo
2025-07-25 23:00         ` Harry Yoo
2025-07-28  2:06           ` liqiong
2025-07-28  3:29             ` Matthew Wilcox
2025-07-28  5:24               ` Harry Yoo
2025-07-28  9:08                 ` liqiong
2025-07-28 13:38                   ` Harry Yoo
2025-07-28  8:52     ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).