Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179119
b: refs/heads/master
c: 04bcef2
h: refs/heads/master
i:
  179117: c57a89d
  179115: 576866e
  179111: 0c3ee3a
  179103: 7df5b2d
v: v3
  • Loading branch information
Arjan van de Ven authored and Patrick McHardy committed Jan 4, 2010
1 parent dadf98d commit b4df144
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae24e578de02b87cce3dc59248c29b2ecb071e9e
refs/heads/master: 04bcef2a83f40c6db24222b27a52892cba39dffb
14 changes: 13 additions & 1 deletion trunk/net/netfilter/ipvs/ip_vs_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,10 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
if (!capable(CAP_NET_ADMIN))
return -EPERM;

if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_SET_MAX)
return -EINVAL;
if (len < 0 || len > MAX_ARG_LEN)
return -EINVAL;
if (len != set_arglen[SET_CMDID(cmd)]) {
pr_err("set_ctl: len %u != %u\n",
len, set_arglen[SET_CMDID(cmd)]);
Expand Down Expand Up @@ -2352,17 +2356,25 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
unsigned char arg[128];
int ret = 0;
unsigned int copylen;

if (!capable(CAP_NET_ADMIN))
return -EPERM;

if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_GET_MAX)
return -EINVAL;

if (*len < get_arglen[GET_CMDID(cmd)]) {
pr_err("get_ctl: len %u < %u\n",
*len, get_arglen[GET_CMDID(cmd)]);
return -EINVAL;
}

if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)
copylen = get_arglen[GET_CMDID(cmd)];
if (copylen > 128)
return -EINVAL;

if (copy_from_user(arg, user, copylen) != 0)
return -EFAULT;

if (mutex_lock_interruptible(&__ip_vs_mutex))
Expand Down

0 comments on commit b4df144

Please sign in to comment.