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: <1285513991.2697.262.camel@localhost>
Date:	Sun, 26 Sep 2010 16:13:11 +0100
From:	Ben Hutchings <ben@...adent.org.uk>
To:	LKML <linux-kernel@...r.kernel.org>, linux-alpha@...r.kernel.org
Subject: [PATCH 2/2] alpha: Make sys_getxpid() call do_getppid()

sys_getxpid() was not following RCU protocol or considering namespace
visibility for the parent pid.  Change it to call do_geptpid() which
does the right thing.

Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
This is totally untested, and I've never written Alpha assembly before,
so this definitely needs review and testing by an Alpha porter.

I've left the shortcut tgid lookup there as I assume it is still valid.

Ben.

 arch/alpha/kernel/entry.S |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index ab1ee0a..5b1bc48 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -857,24 +857,15 @@ sys_getxgid:
 	.globl	sys_getxpid
 	.ent	sys_getxpid
 sys_getxpid:
+	lda	$sp, -16($sp)
+	stq	$26, 0($sp)
 	.prologue 0
+	jsr	$26, do_getppid
+	ldq	$26, 0($sp)
+	lda	$sp, 16($sp)
+	stq	$0, 80($sp)
 	ldq	$2, TI_TASK($8)
-
-	/* See linux/kernel/timer.c sys_getppid for discussion
-	   about this loop.  */
-	ldq	$3, TASK_GROUP_LEADER($2)
-	ldq	$4, TASK_REAL_PARENT($3)
 	ldl	$0, TASK_TGID($2)
-1:	ldl	$1, TASK_TGID($4)
-#ifdef CONFIG_SMP
-	mov	$4, $5
-	mb
-	ldq	$3, TASK_GROUP_LEADER($2)
-	ldq	$4, TASK_REAL_PARENT($3)
-	cmpeq	$4, $5, $5
-	beq	$5, 1b
-#endif
-	stq	$1, 80($sp)
 	ret
 .end sys_getxpid
 
-- 
1.7.1


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