[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4E15F451.5070701@candelatech.com>
Date: Thu, 07 Jul 2011 11:00:49 -0700
From: Ben Greear <greearb@...delatech.com>
To: Christoph Lameter <cl@...ux.com>
CC: penberg@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] slub: Add method to verify memory is not freed.
On 07/01/2011 07:11 AM, Christoph Lameter wrote:
>> +#ifdef CONFIG_SLUB_DEBUG
>> +bool verify_mem_not_deleted(const void *x)
>> +{
>> + struct page *page;
>> + void *object = (void *)x;
>> + unsigned long flags;
>> + bool rv;
>> +
>> + if (unlikely(ZERO_OR_NULL_PTR(x)))
>> + return false;
>> +
>> + local_irq_save(flags);
>> +
>> + page = virt_to_head_page(x);
>> + if (unlikely(!PageSlab(page))) {
>> + /* maybe it was from stack? */
>> + rv = true;
>> + goto out_unlock;
>> + }
>
> The above check is problematic for slabs that have SLAB_DESTROY_BY_RCU
> set. PageSlab(page) may be true to the next rcu interval.
I do not see the problem here. If PageSlab(page) is true, we fall
through and do the check for on-free-list, under the slab_lock().
We only return error if it is on the free list. Would these pages
waiting on the RCU interval show up as in the free list?
Thanks,
Ben
--
Ben Greear <greearb@...delatech.com>
Candela Technologies Inc http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists