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-next>] [day] [month] [year] [list]
Date:	Mon, 16 Apr 2007 10:21:59 +0200 (CEST)
From:	Jerome Borsboom <j.borsboom@...smusmc.nl>
To:	netdev@...r.kernel.org
Subject: [PATCH] parse ip:port strings correctly in in4_pton

in4_pton converts a textual representation of an ip4 address into an 
integer representation. However, when the textual representation is of in 
the form ip:port, c.f. 192.168.1.1:5060, and 'delim' is set to -1, the 
function bails out when parsing the colon.

It makes sense to allow the colon as a delimiting character without 
explicitly having to set it through the 'delim' variable as there can be 
no ambiguity in the point where the ip address is completely parsed. 
Furthermore, this function is indeed called from nf_conntrack_sip.c in 
this way to parse textual ip:port combinations which fails as stated 
above.

Signed-off-by: Jerome Borsboom <j.borsboom@...smusmc.nl>

--- linux-2.6.20/net/core/utils.c	2007-02-04 19:44:54.000000000 +0100
+++ linux-2.6.20/net/core/utils.c	2007-04-15 21:08:55.000000000 +0200
@@ -137,16 +137,16 @@
  	while(1) {
  		int c;
  		c = xdigit2bin(srclen > 0 ? *s : '\0', delim);
-		if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM))) {
+		if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK))) {
  			goto out;
  		}
-		if (c & (IN6PTON_DOT | IN6PTON_DELIM)) {
+		if (c & (IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK)) {
  			if (w == 0)
  				goto out;
  			*d++ = w & 0xff;
  			w = 0;
  			i++;
-			if (c & IN6PTON_DELIM) {
+			if (c & (IN6PTON_DELIM | IN6PTON_COLON_MASK)) {
  				if (i != 4)
  					goto out;
  				break;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ