From: "Ram Gupta" <ram.gupta5@gmail.com>
To: "linux mailing-list" <linux-kernel@vger.kernel.org>
Cc: "Andrew Morton" <akpm@osdl.org>
Subject: [PATCH] security: fix capability bug
Date: Fri, 10 Mar 2006 19:50:27 +0000 [thread overview]
Message-ID: <728201270603101150u20c20d86s851a2885de08e37@mail.gmail.com> (raw)
This patch fixes a bug of ptrace for PTRACE_TRACEME request. In this
case the call is made by the child process & code needs to check the
capabilty of the parent process to trace the child process but code
incorrectly makes check for the child process. Please apply
Signed-off-by: Ram Gupta <ram.gupta5@gmail.com>
----
-- linux-2.6.15.6-rg/security/commoncap.c.orig 2006-03-10
13:22:26.000000000 +0000
+++ linux-2.6.15.6-rg/security/commoncap.c 2006-03-10
13:26:45.000000000 +0000
@@ -59,9 +59,13 @@ int cap_settime(struct timespec *ts, str
int cap_ptrace (struct task_struct *parent, struct task_struct *child)
{
/* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */
- if (!cap_issubset (child->cap_permitted, current->cap_permitted) &&
- !capable(CAP_SYS_PTRACE))
- return -EPERM;
+ if (!cap_issubset (child->cap_permitted, parent->cap_permitted)){
+ if(!cap_capable(parent,CAP_SYS_PTRACE)){
+ parent->flags |= PF_SUPERPRIV;
+ }
+ else
+ return -EPERM;
+ }
return 0;
}
regards
Ram Gupta
next reply other threads:[~2006-03-10 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-10 19:50 Ram Gupta [this message]
2006-03-10 20:52 ` Chris Wright
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=728201270603101150u20c20d86s851a2885de08e37@mail.gmail.com \
--to=ram.gupta5@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®