Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/sys/compat/linux/arch Pull up following revision(s) (re...
details: https://anonhg.NetBSD.org/src/rev/bfd9e2c3d5b9
branches: netbsd-7-0
changeset: 801062:bfd9e2c3d5b9
user: snj <snj%NetBSD.org@localhost>
date: Thu Nov 05 09:35:23 2015 +0000
description:
Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
diffstat:
sys/compat/linux/arch/arm/linux_ptrace.c | 8 +++++---
sys/compat/linux/arch/i386/linux_ptrace.c | 8 +++++---
sys/compat/linux/arch/powerpc/linux_ptrace.c | 8 +++++---
3 files changed, 15 insertions(+), 9 deletions(-)
diffs (138 lines):
diff -r dbfe7133e0eb -r bfd9e2c3d5b9 sys/compat/linux/arch/arm/linux_ptrace.c
--- a/sys/compat/linux/arch/arm/linux_ptrace.c Thu Nov 05 09:30:20 2015 +0000
+++ b/sys/compat/linux/arch/arm/linux_ptrace.c Thu Nov 05 09:35:23 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ptrace.c,v 1.17.14.1 2015/01/17 12:10:55 martin Exp $ */
+/* $NetBSD: linux_ptrace.c,v 1.17.14.1.2.1 2015/11/05 09:35:23 snj Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.17.14.1 2015/01/17 12:10:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.17.14.1.2.1 2015/11/05 09:35:23 snj Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -140,7 +140,6 @@
goto out;
}
mutex_enter(t->p_lock);
- mutex_exit(proc_lock);
/*
* You cannot do what you want to the process if:
@@ -148,6 +147,7 @@
*/
if (!ISSET(t->p_slflag, PSL_TRACED)) {
mutex_exit(t->p_lock);
+ mutex_exit(proc_lock);
error = EPERM;
goto out;
}
@@ -160,9 +160,11 @@
if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
t->p_stat != SSTOP || !t->p_waited) {
mutex_exit(t->p_lock);
+ mutex_exit(proc_lock);
error = EBUSY;
goto out;
}
+ mutex_exit(proc_lock);
/* XXX: ptrace needs revamp for multi-threading support. */
if (t->p_nlwps > 1) {
mutex_exit(t->p_lock);
diff -r dbfe7133e0eb -r bfd9e2c3d5b9 sys/compat/linux/arch/i386/linux_ptrace.c
--- a/sys/compat/linux/arch/i386/linux_ptrace.c Thu Nov 05 09:30:20 2015 +0000
+++ b/sys/compat/linux/arch/i386/linux_ptrace.c Thu Nov 05 09:35:23 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ptrace.c,v 1.28.2.2 2015/01/17 12:10:53 martin Exp $ */
+/* $NetBSD: linux_ptrace.c,v 1.28.2.2.2.1 2015/11/05 09:35:24 snj Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.28.2.2 2015/01/17 12:10:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.28.2.2.2.1 2015/11/05 09:35:24 snj Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -185,7 +185,6 @@
goto out;
}
mutex_enter(t->p_lock);
- mutex_exit(proc_lock);
/*
* You cannot do what you want to the process if:
@@ -193,6 +192,7 @@
*/
if (!ISSET(t->p_slflag, PSL_TRACED)) {
mutex_exit(t->p_lock);
+ mutex_exit(proc_lock);
error = EPERM;
goto out;
}
@@ -205,9 +205,11 @@
if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
t->p_stat != SSTOP || !t->p_waited) {
mutex_exit(t->p_lock);
+ mutex_exit(proc_lock);
error = EBUSY;
goto out;
}
+ mutex_exit(proc_lock);
/* XXX: ptrace needs revamp for multi-threading support. */
if (t->p_nlwps > 1) {
mutex_exit(t->p_lock);
diff -r dbfe7133e0eb -r bfd9e2c3d5b9 sys/compat/linux/arch/powerpc/linux_ptrace.c
--- a/sys/compat/linux/arch/powerpc/linux_ptrace.c Thu Nov 05 09:30:20 2015 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_ptrace.c Thu Nov 05 09:35:23 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ptrace.c,v 1.25.2.2 2015/01/17 12:10:56 martin Exp $ */
+/* $NetBSD: linux_ptrace.c,v 1.25.2.2.2.1 2015/11/05 09:35:24 snj Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.25.2.2 2015/01/17 12:10:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.25.2.2.2.1 2015/11/05 09:35:24 snj Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -162,7 +162,6 @@
goto out;
}
mutex_enter(t->p_lock);
- mutex_exit(proc_lock);
/*
* You cannot do what you want to the process if:
@@ -170,6 +169,7 @@
*/
if (!ISSET(t->p_slflag, PSL_TRACED)) {
mutex_exit(t->p_lock);
+ mutex_exit(proc_lock);
error = EPERM;
goto out;
}
@@ -182,9 +182,11 @@
if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
t->p_stat != SSTOP || !t->p_waited) {
mutex_exit(t->p_lock);
+ mutex_exit(proc_lock);
error = EBUSY;
goto out;
}
+ mutex_exit(proc_lock);
/* XXX: ptrace needs revamp for multi-threading support. */
if (t->p_nlwps > 1) {
mutex_exit(t->p_lock);
Home |
Main Index |
Thread Index |
Old Index