summaryrefslogtreecommitdiffstats
path: root/include/net/sock_reuseport.h
diff options
context:
space:
mode:
authorCraig Gallek <kraig@google.com>2016-01-19 20:27:08 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-19 20:44:23 +0100
commitb4ace4f1ae07691b4f6ea9f3e92efbec083df058 (patch)
tree6845c5f7ff2e8994046ac9a41ea5d5ec00fd21ab /include/net/sock_reuseport.h
parentaf_iucv: Validate socket address length in iucv_sock_bind() (diff)
downloadlinux-b4ace4f1ae07691b4f6ea9f3e92efbec083df058.tar.xz
linux-b4ace4f1ae07691b4f6ea9f3e92efbec083df058.zip
soreuseport: fix NULL ptr dereference SO_REUSEPORT after bind
Marc Dionne discovered a NULL pointer dereference when setting SO_REUSEPORT on a socket after it is bound. This patch removes the assumption that at least one socket in the reuseport group is bound with the SO_REUSEPORT option before other bind calls occur. Fixes: e32ea7e74727 ("soreuseport: fast reuseport UDP socket selection") Reported-by: Marc Dionne <marc.c.dionne@gmail.com> Signed-off-by: Craig Gallek <kraig@google.com> Tested-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock_reuseport.h')
-rw-r--r--include/net/sock_reuseport.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sock_reuseport.h b/include/net/sock_reuseport.h
index 7dda3d7adba8..aecd30308d50 100644
--- a/include/net/sock_reuseport.h
+++ b/include/net/sock_reuseport.h
@@ -16,7 +16,7 @@ struct sock_reuseport {
};
extern int reuseport_alloc(struct sock *sk);
-extern int reuseport_add_sock(struct sock *sk, const struct sock *sk2);
+extern int reuseport_add_sock(struct sock *sk, struct sock *sk2);
extern void reuseport_detach_sock(struct sock *sk);
extern struct sock *reuseport_select_sock(struct sock *sk,
u32 hash,