aboutsummaryrefslogtreecommitdiff
path: root/net/netfilter/xt_osf.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2018-02-01 12:01:59 +0800
committerAlex Shi <alex.shi@linaro.org>2018-02-01 12:01:59 +0800
commit4e5a5112cc603d1dcfe7247723e1c08b8ffbc7ff (patch)
tree0eafc6ed77e008065ece3acd9ea83cc1a19a4122 /net/netfilter/xt_osf.c
parent05eda3c7aedbe06e9692a4a1ca511c6ab3d72de5 (diff)
parent90aaf2f25609f99b63fcbed280716f80b4bc5f56 (diff)
Merge tag 'v3.18.93' into linux-linaro-lsk-v3.18lsk-v3.18-18.02
This is the 3.18.93 stable release
Diffstat (limited to 'net/netfilter/xt_osf.c')
-rw-r--r--net/netfilter/xt_osf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index c529161cdbf8..99f3146b7337 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/capability.h>
#include <linux/if.h>
#include <linux/inetdevice.h>
#include <linux/ip.h>
@@ -69,6 +70,9 @@ static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb,
struct xt_osf_finger *kf = NULL, *sf;
int err = 0;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
if (!osf_attrs[OSF_ATTR_FINGER])
return -EINVAL;
@@ -112,6 +116,9 @@ static int xt_osf_remove_callback(struct sock *ctnl, struct sk_buff *skb,
struct xt_osf_finger *sf;
int err = -ENOENT;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
if (!osf_attrs[OSF_ATTR_FINGER])
return -EINVAL;