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
/
ax25
/
af_ax25.c
diff --git
a/net/ax25/af_ax25.c
b/net/ax25/af_ax25.c
index
7b8db0e
..
a314cfd
100644
(file)
--- a/
net/ax25/af_ax25.c
+++ b/
net/ax25/af_ax25.c
@@
-806,6
+806,9
@@
static int ax25_create(struct net *net, struct socket *sock, int protocol,
struct sock *sk;
ax25_cb *ax25;
+ if (protocol < 0 || protocol > SK_PROTOCOL_MAX)
+ return -EINVAL;
+
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;