va_end(args);
 }
 
+static bool freelist_corrupted(struct kmem_cache *s, struct page *page,
+                              void *freelist, void *nextfree)
+{
+       if ((s->flags & SLAB_CONSISTENCY_CHECKS) &&
+           !check_valid_pointer(s, page, nextfree)) {
+               object_err(s, page, freelist, "Freechain corrupt");
+               freelist = NULL;
+               slab_fix(s, "Isolate corrupted freechain");
+               return true;
+       }
+
+       return false;
+}
+
 static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
 {
        unsigned int off;       /* Offset of last byte */
 static inline void dec_slabs_node(struct kmem_cache *s, int node,
                                                        int objects) {}
 
+static bool freelist_corrupted(struct kmem_cache *s, struct page *page,
+                              void *freelist, void *nextfree)
+{
+       return false;
+}
 #endif /* CONFIG_SLUB_DEBUG */
 
 /*
                void *prior;
                unsigned long counters;
 
+               /*
+                * If 'nextfree' is invalid, it is possible that the object at
+                * 'freelist' is already corrupted.  So isolate all objects
+                * starting at 'freelist'.
+                */
+               if (freelist_corrupted(s, page, freelist, nextfree))
+                       break;
+
                do {
                        prior = page->freelist;
                        counters = page->counters;