Re: [PATCH] 2.2.4 ptrace capability check incorrect, fix

Arvind Sankar (arvinds@mit.edu)
Wed, 24 Mar 1999 17:41:07 -0500


On Wed, Mar 24, 1999 at 11:00:46PM +0200, Topi Miettinen wrote:
> 2.2.4 still has the ptrace capability check wrong.
>
> Observed:
> # bash -c 'sleep 10 & execcap = strace -p $!'
> _exit(0) = ?
>
> Expected:
> # bash -c 'sleep 10 & execcap = strace -p $!'
> attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
>
> -Topi
>
> --- arch/i386/kernel/ptrace.c.orig Wed Mar 24 22:48:35 1999
> +++ arch/i386/kernel/ptrace.c Wed Mar 24 22:48:45 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 */
>

how come the test is there only in the i386 and sparc{,64} ports?

-- arvind

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