From: Christoph Lameter <cl@linux.com>
To: Vasiliy Kulikov <segoon@openwall.com>
Cc: linux-kernel@vger.kernel.org, Pekka Enberg <penberg@kernel.org>,
Matt Mackall <mpm@selenic.com>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, Greg Kroah-Hartman <gregkh@suse.de>,
Al Viro <viro@zeniv.linux.org.uk>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC v3 2/5] slab: implement slab object boundaries assertion
Date: Thu, 21 Jul 2011 11:28:04 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1107211127050.3995@router.home> (raw)
In-Reply-To: <1311252815-6733-1-git-send-email-segoon@openwall.com>
On Thu, 21 Jul 2011, Vasiliy Kulikov wrote:
> +bool slab_access_ok(const void *ptr, unsigned long len)
> +{
> + struct page *page;
> + struct kmem_cache *s = NULL;
Useless assignment.
> + unsigned long offset;
> +
> + if (!virt_addr_valid(ptr))
> + return true;
> + page = virt_to_head_page(ptr);
> + if (!PageSlab(page))
> + return true;
> +
> + s = page->slab;
> + offset = (ptr - page_address(page)) % s->size;
> + if (offset <= s->objsize && len <= s->objsize - offset)
> + return true;
I thought this was going to be offset < s->objectsize ...?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-07-21 16:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-21 12:53 Vasiliy Kulikov
2011-07-21 16:28 ` Christoph Lameter [this message]
2011-07-21 18:13 ` Vasiliy Kulikov
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=alpine.DEB.2.00.1107211127050.3995@router.home \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=mpm@selenic.com \
--cc=penberg@kernel.org \
--cc=segoon@openwall.com \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
/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