lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20060808203159.a317f5d3.akpm@osdl.org>
Date:	Tue, 8 Aug 2006 20:31:59 -0700
From:	Andrew Morton <akpm@...l.org>
To:	Andi Kleen <ak@...e.de>
Cc:	Kirill Korotaev <dev@...ru>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	haveblue@...ibm.com, linux-arch@...r.kernel.org
Subject: Re: [PATCH] sys_getppid oopses on debug kernel

On 09 Aug 2006 05:09:11 +0200
Andi Kleen <ak@...e.de> wrote:

> Kirill Korotaev <dev@...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
> 

I just did something like that:

Similar to ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.6.18-rc3-mm2/broken-out/add-probe_kernel_address.patch

Although I'm not sure it's needed for this problem. A getppid() which does

asmlinkage long sys_getppid(void)
{
	int pid;

	read_lock(&tasklist_lock);
	pid = current->group_leader->real_parent->tgid;
	read_unlock(&tasklist_lock);

	return pid;
}

seems like a fine implementation to me ;)
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ