Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'slab-for-6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab

Pull slab fixes from Vlastimil Babka:

- Fixes for two bugs that can be triggered when debugging options are
enabled (Hao Ge, Vlastimil Babka)

* tag 'slab-for-6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
slab: reset slab->obj_ext when freeing and it is OBJEXTS_ALLOC_FAIL
slab: fix clearing freelist in free_deferred_objects()

+12 -4
+12 -4
mm/slub.c
··· 2170 2170 struct slabobj_ext *obj_exts; 2171 2171 2172 2172 obj_exts = slab_obj_exts(slab); 2173 - if (!obj_exts) 2173 + if (!obj_exts) { 2174 + /* 2175 + * If obj_exts allocation failed, slab->obj_exts is set to 2176 + * OBJEXTS_ALLOC_FAIL. In this case, we end up here and should 2177 + * clear the flag. 2178 + */ 2179 + slab->obj_exts = 0; 2174 2180 return; 2181 + } 2175 2182 2176 2183 /* 2177 2184 * obj_exts was created with __GFP_NO_OBJ_EXT flag, therefore its ··· 6450 6443 slab = virt_to_slab(x); 6451 6444 s = slab->slab_cache; 6452 6445 6446 + /* Point 'x' back to the beginning of allocated object */ 6447 + x -= s->offset; 6448 + 6453 6449 /* 6454 6450 * We used freepointer in 'x' to link 'x' into df->objects. 6455 6451 * Clear it to NULL to avoid false positive detection 6456 6452 * of "Freepointer corruption". 6457 6453 */ 6458 - *(void **)x = NULL; 6454 + set_freepointer(s, x, NULL); 6459 6455 6460 - /* Point 'x' back to the beginning of allocated object */ 6461 - x -= s->offset; 6462 6456 __slab_free(s, slab, x, x, 1, _THIS_IP_); 6463 6457 } 6464 6458