summaryrefslogtreecommitdiff
path: root/net/sctp/ipv6.c
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2021-10-16 13:04:24 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2021-10-16 13:04:24 +0200
commitf8e718054f4421d11638e370b933ccc6c77466ed (patch)
tree973ff8cb8aed7d8e4da6a194456ddc01c206b7de /net/sctp/ipv6.c
parentd900385139e5aa8d584dee92c87bb85d0226253e (diff)
parent1392fe82d7fba00ba4a8e01968935f2b2085d5a4 (diff)
Merge tag 'v4.4.288' into toradex_vf_4.4
This is the 4.4.288 stable release Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'net/sctp/ipv6.c')
-rw-r--r--net/sctp/ipv6.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 1a6849add0e3..62c729402a04 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -488,15 +488,20 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
}
/* Initialize a sctp_addr from an address parameter. */
-static void sctp_v6_from_addr_param(union sctp_addr *addr,
+static bool sctp_v6_from_addr_param(union sctp_addr *addr,
union sctp_addr_param *param,
__be16 port, int iif)
{
+ if (ntohs(param->v6.param_hdr.length) < sizeof(struct sctp_ipv6addr_param))
+ return false;
+
addr->v6.sin6_family = AF_INET6;
addr->v6.sin6_port = port;
addr->v6.sin6_flowinfo = 0; /* BUG */
addr->v6.sin6_addr = param->v6.addr;
addr->v6.sin6_scope_id = iif;
+
+ return true;
}
/* Initialize an address parameter from a sctp_addr and return the length