[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ba26b2e3-0f90-442d-adba-af04829b0f3e@suse.cz>
Date: Mon, 15 Sep 2025 16:48:52 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Harry Yoo <harry.yoo@...cle.com>
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
Christoph Lameter <cl@...two.org>, David Rientjes <rientjes@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/6] slab: validate slab before using it in
alloc_single_from_partial()
On 9/15/25 16:25, Harry Yoo wrote:
> On Mon, Sep 15, 2025 at 03:55:12PM +0200, Vlastimil Babka wrote:
>> @@ -2825,13 +2821,21 @@ static void *alloc_single_from_partial(struct kmem_cache *s,
>>
>> lockdep_assert_held(&n->list_lock);
>>
>> +#ifdef SLUB_DEBUG
>
> I'm sure you meant CONFIG_SLUB_DEBUG ;)
>
> With that adjusted, looks good to me,
> Reviewed-by: Harry Yoo <harry.yoo@...cle.com>
Doh yes, thanks a lot :)
>> + if (s->flags & SLAB_CONSISTENCY_CHECKS) {
>> + if (!validate_slab_ptr(slab)) {
>> + slab_err(s, slab, "Not a valid slab page");
>> + return NULL;
>> + }
>> + }
>> +#endif
>> +
>> object = slab->freelist;
>> slab->freelist = get_freepointer(s, object);
>> slab->inuse++;
>>
>> if (!alloc_debug_processing(s, slab, object, orig_size)) {
>> - if (validate_slab_ptr(slab))
>> - remove_partial(n, slab);
>> + remove_partial(n, slab);
>> return NULL;
>> }
>
Powered by blists - more mailing lists