From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Florian Westphal <fwestphal@astaro.com>,
Patrick McHardy <kaber@trash.net>
Subject: [2/6] netfilter: ebtables: enforce CAP_NET_ADMIN
Date: Thu, 14 Jan 2010 15:04:50 -0800 [thread overview]
Message-ID: <20100114230620.960894210@mini.kroah.org> (raw)
In-Reply-To: <20100114230640.GA7259@kroah.com>
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Florian Westphal <fwestphal@astaro.com>
commit dce766af541f6605fa9889892c0280bab31c66ab upstream.
normal users are currently allowed to set/modify ebtables rules.
Restrict it to processes with CAP_NET_ADMIN.
Note that this cannot be reproduced with unmodified ebtables binary
because it uses SOCK_RAW.
Signed-off-by: Florian Westphal <fwestphal@astaro.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/bridge/netfilter/ebtables.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1436,6 +1436,9 @@ static int do_ebt_set_ctl(struct sock *s
{
int ret;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
switch(cmd) {
case EBT_SO_SET_ENTRIES:
ret = do_replace(user, len);
@@ -1455,6 +1458,9 @@ static int do_ebt_get_ctl(struct sock *s
struct ebt_replace tmp;
struct ebt_table *t;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
if (copy_from_user(&tmp, user, sizeof(tmp)))
return -EFAULT;
next prev parent reply other threads:[~2010-01-14 23:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 23:06 [0/6] 2.6.27.44-stable review Greg KH
2010-01-14 23:04 ` [1/6] kernel/signal.c: fix kernel information leak with print-fatal-signals=1 Greg KH
2010-01-14 23:04 ` Greg KH [this message]
2010-01-14 23:04 ` [3/6] fix braindamage in audit_tree.c untag_chunk() Greg KH
2010-01-14 23:04 ` [4/6] fix more leaks in audit_tree.c tag_chunk() Greg KH
2010-01-14 23:04 ` [5/6] powerpc: Disable VSX or current process in giveup_fpu/altivec Greg KH
2010-01-14 23:04 ` [6/6] powerpc: Handle VSX alignment faults correctly in little-endian mode Greg KH
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=20100114230620.960894210@mini.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=fwestphal@astaro.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable-review@kernel.org \
--cc=stable@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
Powered by JetHome