Re: [PATCH] mm/slub: Avoid list corruption when removing a slab from the full list
From: Christoph Lameter (Ampere)
Date: Mon Oct 07 2024 - 11:59:31 EST
On Sun, 6 Oct 2024, yuan.gao wrote:
> If allocated object failed in alloc_consistency_checks, all objects of
> the slab will be marked as used, and then the slab will be removed from
> the partial list.
Yea so the intend is to isolate the corrupted slab page. There could be
more corrupted data on the page.
> When an object belonging to the slab got freed later, the remove_full()
> function is called. Because the slab is neither on the partial list nor
> on the full list, it eventually lead to a list corruption.
Right. The full list is used in the debug case.
> So we need to add the slab to full list in this case.
That would mean to put the slab with corrupted memory back in circulation.
I guess we would need some check to avoid handling list operations on a
slab page that was removed from the lists because of metadata corruption.