OSDN Git Service

net: Do not allow negative values for busy_read and busy_poll sysctl interfaces
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 24 Mar 2017 16:38:03 +0000 (09:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:22:12 +0000 (14:22 +0100)
commit6a04a7798a3e609a4a01596cbf4433fd095863b6
tree638ff635ac75ecace7e6b204860906dabe44fcd0
parent359f7020464f22686fd0d64911ab4c91c0fb9566
net: Do not allow negative values for busy_read and busy_poll sysctl interfaces

[ Upstream commit 95f255211396958c718aef8c45e3923b5211ea7b ]

This change basically codifies what I think was already the limitations on
the busy_poll and busy_read sysctl interfaces.  We weren't checking the
lower bounds and as such could input negative values. The behavior when
that was used was dependent on the architecture. In order to prevent any
issues with that I am just disabling support for values less than 0 since
this way we don't have to worry about any odd behaviors.

By limiting the sysctl values this way it also makes it consistent with how
we handle the SO_BUSY_POLL socket option since the value appears to be
reported as a signed integer value and negative values are rejected.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/sysctl_net_core.c