From: Luciano Coelho <luciano.coelho@nokia.com>
To: ext Changli Gao <xiaosuo@gmail.com>
Cc: "kaber@trash.net" <kaber@trash.net>,
"netfilter-devel@vger.kernel.org"
<netfilter-devel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
James Morris <jmorris@namei.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH] netfilter: xt_condition: add security capability support
Date: Mon, 23 Aug 2010 16:42:15 +0300 [thread overview]
Message-ID: <1282570935.7198.5.camel@powerslave> (raw)
In-Reply-To: <AANLkTi=2H+ytOQU9nC_dRp_GB5Sy1831VY14oW=YSOrG@mail.gmail.com>
On Mon, 2010-08-23 at 15:37 +0200, ext Changli Gao wrote:
> On Mon, Aug 23, 2010 at 8:50 PM, <luciano.coelho@nokia.com> wrote:
> > From: Luciano Coelho <luciano.coelho@nokia.com>
> >
> > Add a module parameter that allows the required security capability to
> > change the conditions from userspace to be specified. By default the
> > module will require the CAP_NET_ADMIN capability.
> >
> > Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
> > ---
> > net/netfilter/xt_condition.c | 10 ++++++++++
> > 1 files changed, 10 insertions(+), 0 deletions(-)
> >
> > diff --git a/net/netfilter/xt_condition.c b/net/netfilter/xt_condition.c
> > index 06205aa..fd279e5 100644
> > --- a/net/netfilter/xt_condition.c
> > +++ b/net/netfilter/xt_condition.c
> > @@ -29,11 +29,13 @@
> > #include <linux/netfilter/xt_condition.h>
> > #include <net/netns/generic.h>
> > #include <asm/uaccess.h>
> > +#include <linux/capability.h>
> >
> > /* Defaults, these can be overridden on the module command-line. */
> > static unsigned int condition_list_perms = S_IRUGO | S_IWUSR;
> > static unsigned int condition_uid_perms = 0;
> > static unsigned int condition_gid_perms = 0;
> > +static unsigned int condition_capabilities = CAP_NET_ADMIN;
> >
> > MODULE_AUTHOR("Stephane Ouellette <ouellettes@videotron.ca>");
> > MODULE_AUTHOR("Massimiliano Hofer <max@nucleus.it>");
> > @@ -47,6 +49,8 @@ module_param(condition_uid_perms, uint, S_IRUSR | S_IWUSR);
> > MODULE_PARM_DESC(condition_uid_perms, "default user owner of /proc/net/nf_condition/* files");
> > module_param(condition_gid_perms, uint, S_IRUSR | S_IWUSR);
> > MODULE_PARM_DESC(condition_gid_perms, "default group owner of /proc/net/nf_condition/* files");
> > +module_param(condition_capabilities, uint, CAP_NET_ADMIN);
> > +MODULE_PARM_DESC(condition_capabilities, "default capabilities required to change /proc/net/nf_condition/* files");
>
> It is strange that we set security policy in this way. Maybe the
> permission of the proc file is enough in this case.
Yes, that is another way to do it. But in our device we use security
capabilities more extensively than normal file permissions. That's why
we need this.
If this is too restrictive (ie. having CAP_NET_ADMIN) for most users, we
could change the default value to no capabilities needed. Then we can
set CAP_NET_ADMIN when loading the module.
--
Cheers,
Luca.
next prev parent reply other threads:[~2010-08-23 13:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-23 12:50 [PATCH] netfilter: xt_condition: add security capability support luciano.coelho
2010-08-23 13:37 ` Changli Gao
2010-08-23 13:42 ` Luciano Coelho [this message]
2010-08-23 14:34 ` Jan Engelhardt
2010-08-23 18:45 ` Luciano Coelho
2010-08-23 18:58 ` Jan Engelhardt
2010-08-24 7:00 ` Luciano Coelho
2010-08-24 7:32 ` Jan Engelhardt
2010-08-25 7:09 ` Luciano Coelho
2010-08-25 9:04 ` Jan Engelhardt
2010-08-27 7:55 ` Luciano Coelho
2010-09-15 20:14 ` Patrick McHardy
2010-09-21 19:56 ` Luciano Coelho
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=1282570935.7198.5.camel@powerslave \
--to=luciano.coelho@nokia.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=linux-security-module@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).