git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
net: add validation for the socket syscall protocol argument
[pandora-kernel.git]
/
net
/
ipv4
/
af_inet.c
diff --git
a/net/ipv4/af_inet.c
b/net/ipv4/af_inet.c
index
5d228de
..
e2ab968
100644
(file)
--- a/
net/ipv4/af_inet.c
+++ b/
net/ipv4/af_inet.c
@@
-279,6
+279,9
@@
static int inet_create(struct net *net, struct socket *sock, int protocol,
int try_loading_module = 0;
int err;
+ if (protocol < 0 || protocol >= IPPROTO_MAX)
+ return -EINVAL;
+
if (unlikely(!inet_ehash_secret))
if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM)
build_ehash_secret();