summaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-12-04 00:42:13 +0100
committerJakub Kicinski <kuba@kernel.org>2020-12-04 00:44:09 +0100
commit55fd59b003f6e8fd88cf16590e79823d7ccf3026 (patch)
treef23b2225f1a00b80632d612428708d5a57ad330b /net/x25
parentMerge branch 'mptcp-reject-invalid-mp_join-requests-right-away' (diff)
parentMerge tag 'net-5.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadlinux-55fd59b003f6e8fd88cf16590e79823d7ccf3026.tar.xz
linux-55fd59b003f6e8fd88cf16590e79823d7ccf3026.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Conflicts: drivers/net/ethernet/ibm/ibmvnic.c Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 9232cdb42ad9..d41fffb2507b 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -675,7 +675,8 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
int len, i, rc = 0;
if (addr_len != sizeof(struct sockaddr_x25) ||
- addr->sx25_family != AF_X25) {
+ addr->sx25_family != AF_X25 ||
+ strnlen(addr->sx25_addr.x25_addr, X25_ADDR_LEN) == X25_ADDR_LEN) {
rc = -EINVAL;
goto out;
}
@@ -769,7 +770,8 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr,
rc = -EINVAL;
if (addr_len != sizeof(struct sockaddr_x25) ||
- addr->sx25_family != AF_X25)
+ addr->sx25_family != AF_X25 ||
+ strnlen(addr->sx25_addr.x25_addr, X25_ADDR_LEN) == X25_ADDR_LEN)
goto out;
rc = -ENETUNREACH;