aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/sysctl_net_ipv4.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-07-25 17:34:32 +0100
committerMark Brown <broonie@kernel.org>2018-07-25 17:34:32 +0100
commit606b3effb9ce2ab6f67eeecace381c701d411ecf (patch)
tree2f9478b4cdd0703734c76570f61309b304de0933 /net/ipv4/sysctl_net_ipv4.c
parent1c6a1d5ae62dbaec8922761f56332e6e830b32a4 (diff)
parent762b585c492fedda1b0bc4c6d0a867307bf7cd0f (diff)
Merge tag 'v4.4.144' into linux-linaro-lsk-v4.4lsk-v4.4-18.07
This is the 4.4.144 stable release
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r--net/ipv4/sysctl_net_ipv4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 75abf978ef30..da90c74d12ef 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -141,8 +141,9 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write,
if (write && ret == 0) {
low = make_kgid(user_ns, urange[0]);
high = make_kgid(user_ns, urange[1]);
- if (!gid_valid(low) || !gid_valid(high) ||
- (urange[1] < urange[0]) || gid_lt(high, low)) {
+ if (!gid_valid(low) || !gid_valid(high))
+ return -EINVAL;
+ if (urange[1] < urange[0] || gid_lt(high, low)) {
low = make_kgid(&init_user_ns, 1);
high = make_kgid(&init_user_ns, 0);
}