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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081104151234.GH28946@ZenIV.linux.org.uk>
Date:	Tue, 4 Nov 2008 15:12:35 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Vegard Nossum <vegard.nossum@...il.com>
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	"Koyama, Yoshiya" <Yoshiya.Koyama@...com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Pekka Enberg <penberg@...helsinki.fi>,
	LKML <linux-kernel@...r.kernel.org>, Greg KH <greg@...ah.com>,
	Kay Sievers <kay.sievers@...y.org>,
	linux-fsdevel@...r.kernel.org
Subject: Re: v2.6.28-rc1: readlink /proc/*/exe returns uninitialized data
	to userspace

On Tue, Nov 04, 2008 at 10:39:19AM +0100, Vegard Nossum wrote:
> On Sun, Oct 26, 2008 at 10:08 PM, Vegard Nossum <vegard.nossum@...il.com> wrote:
> # uname -a
> Linux localhost.localdomain 2.6.25.11-97.fc9.i686 #1 SMP Mon Jul 21
> 01:31:09 EDT 2008 i686 i686 i386 GNU/Linux
> # prelink -mRf /sbin/udevd
> # ./a.out /proc/564/exe
> warning: /proc/564/exe: got return value 38, expected 11
> 2f7362696e2f7564657664005f47387942426e5952446e566f306868202864656c6574656429
> /sbin/udevd _G8yBBnYRDnVo0hh (deleted)
> 
> Yoshiya Koyama reports that the problem exists on RHEL 2.6.9-42.ELsmp too.
> 
> I don't think it's exactly the same problem as originally reported,
> because I definitely wasn't using prelinking (the prelink binary
> wasn't even installed on the machine until today). But finding the
> root cause of this may solve both problems.

switch_names() buggered in case of short names on both sides.  That should
help:

>From 2acda856910b774717e0290bbf948c7dee0f2e1a Mon Sep 17 00:00:00 2001
From: Al Viro <viro@...iv.linux.org.uk>
Date: Mon, 3 Nov 2008 15:03:50 -0500
Subject: [PATCH] fix switch_names() breakage in short-to-short case

We want ->name.len to match the resulting name on *both*
source and target

Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
 fs/dcache.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index a1d86c7..15e4f83 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1620,8 +1620,11 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
 			 */
 			memcpy(dentry->d_iname, target->d_name.name,
 					target->d_name.len + 1);
+			dentry->d_name.len = target->d_name.len;
+			return;
 		}
 	}
+	do_switch(dentry->d_name.len, target->d_name.len);
 }
 
 /*
@@ -1681,7 +1684,6 @@ already_unhashed:
 
 	/* Switch the names.. */
 	switch_names(dentry, target);
-	do_switch(dentry->d_name.len, target->d_name.len);
 	do_switch(dentry->d_name.hash, target->d_name.hash);
 
 	/* ... and switch the parents */
@@ -1791,7 +1793,6 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
 	struct dentry *dparent, *aparent;
 
 	switch_names(dentry, anon);
-	do_switch(dentry->d_name.len, anon->d_name.len);
 	do_switch(dentry->d_name.hash, anon->d_name.hash);
 
 	dparent = dentry->d_parent;
-- 
1.5.6.5

--
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