In rds_bind(), it does not check if a socket is already bound
or not. Hence a second bind() will overwrite what is done in
the first bind().
Orabug:
27463500
Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
/*
- * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
lock_sock(sk);
+ /* RDS socket does not allow re-binding. */
+ if (!ipv6_addr_any(&rs->rs_bound_addr)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
ret = rds_add_bound(rs, binding_addr, &port, scope_id);
if (ret)
goto out;