summaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2019-11-26 23:44:16 +0100
committerDavid S. Miller <davem@davemloft.net>2019-11-27 00:15:07 +0100
commit66e2f5f7c7728862e9394769722231b9ce3d8672 (patch)
tree99662083152383e3e5ebb299a6fd9dc9c88550b2 /include/net/ip.h
parentopenvswitch: fix flow command message size (diff)
downloadlinux-66e2f5f7c7728862e9394769722231b9ce3d8672.tar.xz
linux-66e2f5f7c7728862e9394769722231b9ce3d8672.zip
net: inet_is_local_reserved_port() port arg should be unsigned short
Any argument outside of that range would result in an out of bound memory access, since the accessed array is 65536 bits long. Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--include/net/ip.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 5a61bd948b18..02d68e346f67 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -339,7 +339,7 @@ static inline u64 snmp_fold_field64(void __percpu *mib, int offt, size_t syncp_o
void inet_get_local_port_range(struct net *net, int *low, int *high);
#ifdef CONFIG_SYSCTL
-static inline bool inet_is_local_reserved_port(struct net *net, int port)
+static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port)
{
if (!net->ipv4.sysctl_local_reserved_ports)
return false;
@@ -357,7 +357,7 @@ static inline bool inet_port_requires_bind_service(struct net *net, unsigned sho
}
#else
-static inline bool inet_is_local_reserved_port(struct net *net, int port)
+static inline bool inet_is_local_reserved_port(struct net *net, unsigned short port)
{
return false;
}