From: Chris Wright <chrisw@sous-sol.org>
To: "Andrew G. Morgan" <morgan@kernel.org>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dmitry Adamushko <dmitry.adamushko@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bugfix: was Re: [ linus-git ] prctl(PR_SET_KEEPCAPS, ...) is broken for some configs, e.g. CONFIG_SECURITY_SELINUX
Date: Tue, 10 Jun 2008 12:14:55 -0700 [thread overview]
Message-ID: <20080610191451.GL4018@sequoia.sous-sol.org> (raw)
In-Reply-To: <484E0280.2050305@kernel.org>
* Andrew G. Morgan (morgan@kernel.org) wrote:
> --- a/security/dummy.c
> +++ b/security/dummy.c
> @@ -27,6 +27,8 @@
> #include <linux/hugetlb.h>
> #include <linux/ptrace.h>
> #include <linux/file.h>
> +#include <linux/prctl.h>
> +#include <linux/securebits.h>
>
> static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
> {
> @@ -607,7 +609,27 @@ static int dummy_task_kill (struct task_struct *p, struct siginfo *info,
> static int dummy_task_prctl (int option, unsigned long arg2, unsigned long arg3,
> unsigned long arg4, unsigned long arg5, long *rc_p)
> {
> - return 0;
> + switch (option) {
> + case PR_CAPBSET_READ:
> + *rc_p = (cap_valid(arg2) ? 1 : -EINVAL);
> + break;
Do we need this one? It's new to 2.6.25, so I think we could not
worry about emulating it here.
> + case PR_GET_KEEPCAPS:
> + *rc_p = issecure(SECURE_KEEP_CAPS);
> + break;
> + case PR_SET_KEEPCAPS:
> + if (arg2 > 1)
> + *rc_p = -EINVAL;
> + else if (arg2)
> + current->securebits |= issecure_mask(SECURE_KEEP_CAPS);
> + else
> + current->securebits &=
> + ~issecure_mask(SECURE_KEEP_CAPS);
> + break;
> + default:
> + return 0;
> + }
> +
> + return 1;
> }
>
> static void dummy_task_reparent_to_init (struct task_struct *p)
next prev parent reply other threads:[~2008-06-10 19:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-08 13:38 [ linus-git ] prctl(PR_SET_KEEPCAPS, ...) is broken for some configs, e.g. CONFIG_SECURITY_SELINUX Dmitry Adamushko
2008-06-08 15:10 ` Andrew Morgan
2008-06-08 18:06 ` Andrew Morton
2008-06-08 22:34 ` Andrew Morgan
2008-06-08 23:39 ` Andrew Morton
2008-06-09 17:17 ` Serge E. Hallyn
2008-06-10 4:26 ` [PATCH] bugfix: was " Andrew G. Morgan
2008-06-10 5:21 ` Andrew Morton
2008-06-10 19:12 ` Serge E. Hallyn
2008-06-11 0:39 ` Andrew G. Morgan
2008-06-10 19:14 ` Chris Wright [this message]
2008-06-11 0:37 ` Andrew G. Morgan
2008-06-11 14:21 ` Dmitry Adamushko
2008-06-10 16:12 ` 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=20080610191451.GL4018@sequoia.sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=akpm@linux-foundation.org \
--cc=dmitry.adamushko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=morgan@kernel.org \
--cc=serue@us.ibm.com \
--cc=torvalds@linux-foundation.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