diff options
author | Ingo Molnar <mingo@kernel.org> | 2020-07-26 19:52:16 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-07-26 19:52:30 +0200 |
commit | 2d65685a4a6ff6ef6bfe42717222db92c04224c2 (patch) | |
tree | 894aebbf77ce53375e999cd5c6bb34ee5d28bb9f /net/ax25 | |
parent | de0038bfaf53af0e8bc4961b7aacdcb79f43bf08 (diff) | |
parent | fbe0d451bcea569fc0ed3455511a90646c8a9c81 (diff) | |
download | linux-2d65685a4a6ff6ef6bfe42717222db92c04224c2.tar.bz2 |
Merge branch 'x86/urgent' into x86/cleanups
Refresh the branch for a dependent commit.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/ax25')
-rw-r--r-- | net/ax25/af_ax25.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index fd91cd34f25e..dec3f35467c9 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1187,7 +1187,10 @@ static int __must_check ax25_connect(struct socket *sock, if (addr_len > sizeof(struct sockaddr_ax25) && fsa->fsa_ax25.sax25_ndigis != 0) { /* Valid number of digipeaters ? */ - if (fsa->fsa_ax25.sax25_ndigis < 1 || fsa->fsa_ax25.sax25_ndigis > AX25_MAX_DIGIS) { + if (fsa->fsa_ax25.sax25_ndigis < 1 || + fsa->fsa_ax25.sax25_ndigis > AX25_MAX_DIGIS || + addr_len < sizeof(struct sockaddr_ax25) + + sizeof(ax25_address) * fsa->fsa_ax25.sax25_ndigis) { err = -EINVAL; goto out_release; } @@ -1507,7 +1510,10 @@ static int ax25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) struct full_sockaddr_ax25 *fsa = (struct full_sockaddr_ax25 *)usax; /* Valid number of digipeaters ? */ - if (usax->sax25_ndigis < 1 || usax->sax25_ndigis > AX25_MAX_DIGIS) { + if (usax->sax25_ndigis < 1 || + usax->sax25_ndigis > AX25_MAX_DIGIS || + addr_len < sizeof(struct sockaddr_ax25) + + sizeof(ax25_address) * usax->sax25_ndigis) { err = -EINVAL; goto out; } |