lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat,  1 May 2021 18:32:30 +0200
From:   Andrea Claudi <aclaudi@...hat.com>
To:     netdev@...r.kernel.org
Cc:     stephen@...workplumber.org, dsahern@...il.com
Subject: [PATCH iproute2 2/2] tipc: bail out if key is abnormally long

tipc segfaults when called with an abnormally long key:

$ tipc node set key 0123456789abcdef0123456789abcdef0123456789abcdef
*** buffer overflow detected ***: terminated

Fix this returning an error if key length is longer than
TIPC_AEAD_KEYLEN_MAX.

Fixes: 24bee3bf9752 ("tipc: add new commands to set TIPC AEAD key")
Signed-off-by: Andrea Claudi <aclaudi@...hat.com>
---
 tipc/misc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tipc/misc.c b/tipc/misc.c
index 1daf3072..909975d8 100644
--- a/tipc/misc.c
+++ b/tipc/misc.c
@@ -113,6 +113,9 @@ int str2key(char *str, struct tipc_aead_key *key)
 	    }
 	}
 
+	if (len > TIPC_AEAD_KEYLEN_MAX)
+		return -1;
+
 	/* Obtain key: */
 	if (!ishex) {
 		key->keylen = len;
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ