Re: [BK PATCH] Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pablo Neira wrote:

Patrick, what about this? this way we save a copy to a buffer for linear skbs.

Signed-off-by: Pablo Neira Ayuso <pablo@eurodev.net>

@@ -74,12 +75,17 @@
				 skb->len - dataoff, amanda_buffer);
	BUG_ON(amp == NULL);
	data = amp;
-	data_limit = amp + skb->len - dataoff;
-	*data_limit = '\0';

/* Search for the CONNECT string */
- data = strstr(data, "CONNECT ");
- if (!data)
+ while((data = memchr(data, 'C', skb->len - dataoff)) != NULL) {
+ if (strncmp(data, "CONNECT ", 8) == 0) {


What if the C is the last byte ? There are also more str* commands below
that need a terminating 0-byte.

Regards
Patrick

+			found = 1;
+			break;
+		}
+		data++;
+	}
+
+	if (!found)
		goto out;
	data += strlen("CONNECT ");




- : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux