public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Christoph Lameter <cl@linux.com>
Cc: penberg@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] slub:  Add method to verify memory is not freed.
Date: Thu, 07 Jul 2011 11:00:49 -0700	[thread overview]
Message-ID: <4E15F451.5070701@candelatech.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1107010909060.2458@router.home>

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@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


      parent reply	other threads:[~2011-07-07 18:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29  0:47 [PATCH v2 0/2] SLUB memory debugging improvements greearb
2011-06-29  0:47 ` [PATCH v2 1/2] slub: Enable backtrace for create/delete points greearb
2011-07-01 14:08   ` Christoph Lameter
2011-07-01 14:20     ` Ben Greear
2011-06-29  0:47 ` [PATCH v2 2/2] slub: Add method to verify memory is not freed greearb
2011-07-01 14:11   ` Christoph Lameter
2011-07-01 14:23     ` Ben Greear
2011-07-07 18:00     ` Ben Greear [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E15F451.5070701@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox