aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_sockglue.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-08-06 06:33:15 -0700
committerDavid S. Miller <davem@davemloft.net>2005-08-06 06:33:15 -0700
commit6fc0b4a7a73a81e74d0004732df358f4f9975be2 (patch)
treeac2c68e206efbfe378728a50be30ef0bccd0cdff /net/ipv4/ip_sockglue.c
parent534afb90a9cd0b9643f62d660c164e1d924f39cf (diff)
downloadkernel_samsung_smdk4412-6fc0b4a7a73a81e74d0004732df358f4f9975be2.zip
kernel_samsung_smdk4412-6fc0b4a7a73a81e74d0004732df358f4f9975be2.tar.gz
kernel_samsung_smdk4412-6fc0b4a7a73a81e74d0004732df358f4f9975be2.tar.bz2
[IPSEC]: Restrict socket policy loading to CAP_NET_ADMIN.
The interface needs much redesigning if we wish to allow normal users to do this in some way. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r--net/ipv4/ip_sockglue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index fc7c481..ff4bd06 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -848,6 +848,9 @@ mc_msf_out:
case IP_IPSEC_POLICY:
case IP_XFRM_POLICY:
+ err = -EPERM;
+ if (!capable(CAP_NET_ADMIN))
+ break;
err = xfrm_user_policy(sk, optname, optval, optlen);
break;