From: "Dmitry Adamushko" <dmitry.adamushko@gmail.com>
To: "Andrew G. Morgan" <morgan@kernel.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [ linus-git ] prctl(PR_SET_KEEPCAPS, ...) is broken for some configs, e.g. CONFIG_SECURITY_SELINUX
Date: Sun, 8 Jun 2008 14:40:29 +0200 [thread overview]
Message-ID: <b647ffbd0806080540w6dde917di1d7b812f01a4d81a@mail.gmail.com> (raw)
Hi,
the commit 3898b1b4ebff8dcfbcf1807e0661585e06c9a91c has broken (always
-EINVAL as a return value)
prctl(PR_SET_KEEPCAPS, {1 | 0}, 0, 0, 0);
for the following configs:
1) CONFIG_SECURITY but without any of CONFIG_SECURITY_* modules;
2) CONFIG_SECURITY + CONFIG_SECURITY_SELINUX + CONFIG_SECURITY_SELINUX_DISABLE
both fall back to 'dummy' implementation.
3) CONFIG_SECURITY + CONFIG_SECURITY_SELINUX
for this config it will work when there is a secondary security module.
Here is what happens:
Processing of PR_SET_KEEPCAPS (and a couple of other options) has been
moved from kernel/sys.c::sys_prctl()
to security/commoncap.c::cap_task_prctl().
For the aforementioned configs cap_task_prctl() is not called
(moreover, security/commoncap.c is not compiled).
SELinux's implementation of .task_prctl callback resorts to
secondary_ops->task_prctl() which is dummy_task_prctl() (in the
absence of CONFIG_SECURITY_CAPABILITIES (or any other) as a secondary
module).
So the relevant code should be either moved back to sys_prctl() or
placed in some generic function (not in security/commoncap.c) which is
accessible for all configs.
p.s. perhaps, some would argue that such behavior might have its own
advantages. e.g. 'dhclient' on Ubuntu (for sure on 7.04) refuses to
work and, as a result, a crowd of Ubuntu followers turn their backs on
the virtual world and finally spend more time with their families. It
might be also good for the noble cause of fighting global warming...
heh, provided people don't escape into another virtual world by means
of shiny plasma-TVs :-)
--
Best regards,
Dmitry Adamushko
next reply other threads:[~2008-06-08 12:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-08 12:40 Dmitry Adamushko [this message]
2008-06-08 13:38 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 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=b647ffbd0806080540w6dde917di1d7b812f01a4d81a@mail.gmail.com \
--to=dmitry.adamushko@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=morgan@kernel.org \
--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
all inboxes | Powered by JetHome®