]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ipv4: Return EINVAL when ping_group_range sysctl doesn't map to user ns
authorTyler Hicks <tyhicks@canonical.com>
Thu, 5 Jul 2018 18:49:23 +0000 (18:49 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Feb 2019 04:53:01 +0000 (04:53 +0000)
commit756bfe6c232ec7b1bd9ae84933dc4cf057c24c80
tree07ce5307496d3ec08efbb2c7553047d42eef43ee
parentafdd07f60eb6c6f8b58885474b73546e00a79214
ipv4: Return EINVAL when ping_group_range sysctl doesn't map to user ns

BugLink: http://bugs.launchpad.net/bugs/1812229
[ Upstream commit 70ba5b6db96ff7324b8cfc87e0d0383cf59c9677 ]

The low and high values of the net.ipv4.ping_group_range sysctl were
being silently forced to the default disabled state when a write to the
sysctl contained GIDs that didn't map to the associated user namespace.
Confusingly, the sysctl's write operation would return success and then
a subsequent read of the sysctl would indicate that the low and high
values are the overflowgid.

This patch changes the behavior by clearly returning an error when the
sysctl write operation receives a GID range that doesn't map to the
associated user namespace. In such a situation, the previous value of
the sysctl is preserved and that range will be returned in a subsequent
read of the sysctl.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/ipv4/sysctl_net_ipv4.c