summaryrefslogtreecommitdiffstats
path: root/net/ax25
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-07-26 19:52:16 +0200
committerIngo Molnar <mingo@kernel.org>2020-07-26 19:52:30 +0200
commit2d65685a4a6ff6ef6bfe42717222db92c04224c2 (patch)
tree894aebbf77ce53375e999cd5c6bb34ee5d28bb9f /net/ax25
parentde0038bfaf53af0e8bc4961b7aacdcb79f43bf08 (diff)
parentfbe0d451bcea569fc0ed3455511a90646c8a9c81 (diff)
downloadlinux-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.c10
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;
}