From: Andi Kleen <ak@suse.de>
To: Kirill Korotaev <dev@sw.ru>
Cc: Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
haveblue@us.ibm.com, linux-arch@vger.kernel.org
Subject: Re: [PATCH] sys_getppid oopses on debug kernel
Date: 09 Aug 2006 05:09:11 +0200 [thread overview]
Message-ID: <p73lkpyobag.fsf@verdi.suse.de> (raw)
In-Reply-To: <44D8B12C.40200@sw.ru>
Kirill Korotaev <dev@sw.ru> writes:
[adding linux-arch]
> > Accessing freed memory is a bug, always, not just *only* when slab
> > debugging is on, right? Doesn't this mean we could get junk, or that
> > the reader could potentially run off a bad pointer?
> no, read the comment in sys_getppid.
> It is a valid optimization. _safe_ and alowing to bypass taking the lock.
> BUT! This optimization relies on the fact that kernel memory (DMA + normal zone)
> is always mapped into virtual address space.
> Which is invalid for debug kernels only.
In x86 arch code we would use __get_user for this (and we do in a couple
of places). But it wouldn't be portable because sometimes _user is
in a different address space.
Maybe it would be time to make a similar facility (read/write_kernel_safe() or similar)
with error return available to generic code?
It should be easy to implement - iirc near all architectures already
use the exception handling frame work and it is a simple extension
of that. x86 could just define it to __put/get_user
-Andi
next parent reply other threads:[~2006-08-09 3:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <44D865FD.1040806@sw.ru>
[not found] ` <1155050817.19249.42.camel@localhost.localdomain>
[not found] ` <44D8B12C.40200@sw.ru>
2006-08-09 3:09 ` Andi Kleen [this message]
2006-08-09 3:31 ` [PATCH] sys_getppid oopses on debug kernel Andrew Morton
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=p73lkpyobag.fsf@verdi.suse.de \
--to=ak@suse.de \
--cc=akpm@osdl.org \
--cc=dev@sw.ru \
--cc=haveblue@us.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.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