sctp: Fix smatch error in ASCONF code
Subsystems (2)
PATCH 1/1 sctp: Fix smatch error in ASCONF code
Fix up a missed null pointer check in the asconf code. If we don't find a local address, but we pass in an address length of more than 1, we may dereference a NULL laddr pointer. Currently this can't happen, as the only users of the function pass in the value 1 as the addrcnt parameter, but its not a hot path, and it doesn't hurt to check for NULL should that ever be the case
Signed-off-by Neil Horman <[email protected]>
CC Vlad Yasevich <[email protected]>
CC "David S. Miller" <[email protected]>
CC Dan Carpenter <[email protected]>
--- net/sctp/socket.c | 3 +++ 1 file changed, 3 insertions(+)
net/sctp/socket.c +3 -0
@@ -820,6 +820,9 @@ static int sctp_send_asconf_del_ip(struct sock *sk, goto skip_mkasconf; } +if (laddr =NULL ) +return -EINVAL ; +/* We do not need RCU protection throughout this loop * because this is done under a socket lock from the * setsockopt call.
Signature · 1 line
1.7.11.7