From: Vasiliy Kulikov <segoon@openwall.com>
To: Christoph Lameter <cl@linux.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 22:13:00 +0400 [thread overview]
Message-ID: <20110721181300.GA23960@albatros> (raw)
In-Reply-To: <alpine.DEB.2.00.1107211127050.3995@router.home>
On Thu, Jul 21, 2011 at 11:28 -0500, Christoph Lameter wrote:
> 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 ...?
Looks like I did these 2 things in SLAB only, left SLUB untouched.
Will fix, thanks.
--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments
--
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>
prev parent reply other threads:[~2011-07-21 18:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-21 12:53 [RFC v3 2/5] slab: implement slab object boundaries assertion Vasiliy Kulikov
2011-07-21 16:28 ` Christoph Lameter
2011-07-21 18:13 ` Vasiliy Kulikov [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=20110721181300.GA23960@albatros \
--to=segoon@openwall.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--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=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;
as well as URLs for NNTP newsgroup(s).