Re: [patch-bugfix] Re: 2.2.4 breaks strace -f

Keith Owens (kaos@ocs.com.au)
Wed, 24 Mar 1999 14:38:55 -0800


On Wed, 24 Mar 1999 21:37:12 +0000 (GMT),
Tigran Aivazian <tigran@aivazian.demon.co.uk> wrote:
>The patch below fixes the PTRACE_ATTACH problem.
>--- ptrace.c.0 Wed Mar 24 21:03:52 1999
>+++ ptrace.c Wed Mar 24 21:23:33 1999
>@@ -386,7 +386,7 @@
> (current->uid != child->uid) ||
> (current->gid != child->egid) ||
> (current->gid != child->sgid) ||
>- (cap_issubset(child->cap_permitted, current->cap_permitted)) ||
>+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
> (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
> goto out;
> /* the same process cannot be attached many times */
>

Works for me. BTW, sparc and sparc64 have the same problem, identical
change.

Index: linux/arch/sparc64/kernel/ptrace.c
--- linux/arch/sparc64/kernel/ptrace.c.orig Tue, 23 Mar 1999 15:22:04 -0800 keith (linux-2.2/r/b/27_ptrace.c 1.2 644) 4.2
+++ linux/arch/sparc64/kernel/ptrace.c Wed, 24 Mar 1999 14:28:30 -0800 keith (linux-2.2/r/b/27_ptrace.c 1.2 644) 4.2(w)
@@ -605,7 +605,7 @@
(current->uid != child->uid) ||
(current->gid != child->egid) ||
(current->gid != child->sgid) ||
- (cap_issubset(child->cap_permitted, current->cap_permitted)) ||
+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) {
pt_error_return(regs, EPERM);
goto out;
Index: linux/arch/sparc/kernel/ptrace.c
--- linux/arch/sparc/kernel/ptrace.c.orig Tue, 23 Mar 1999 15:22:04 -0800 keith (linux-2.2/B/b/48_ptrace.c 1.2 644) 4.2
+++ linux/arch/sparc/kernel/ptrace.c Wed, 24 Mar 1999 14:28:35 -0800 keith (linux-2.2/B/b/48_ptrace.c 1.2 644) 4.2(w)
@@ -542,7 +542,7 @@
(current->uid != child->uid) ||
(current->gid != child->egid) ||
(current->gid != child->sgid) ||
- (cap_issubset(child->cap_permitted, current->cap_permitted)) ||
+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) {
pt_error_return(regs, EPERM);
goto out;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/