Browse Source

Cherry-pick (aoeping:) "Check amount of data read from network before using it"

Christoph Biedl 3 years ago
parent
commit
0932e4698d

+ 17 - 0
debian/patches/cherry-pick/1434503415.aoetools-36-2-ge50247f.check-amount-of-data-read-from-network-before-using-it.patch

@@ -0,0 +1,17 @@
+Subject: Check amount of data read from network before using it
+Origin: aoetools-36-2-ge50247f <https://github.com/OpenAoE/aoetools/commit/aoetools-36-2-ge50247f>
+Upstream-Author: Ed Cashin <ed.cashin@acm.org>
+Date: Tue Jun 16 21:10:15 2015 -0400
+
+--- a/aoeping.c
++++ b/aoeping.c
+@@ -359,6 +359,9 @@
+ 	}
+ 	n = aoe_pkt_read(buf, sizeof buf, c, tag);
+ 	p = (Ata *) buf;
++	/* We're expecting the AoE and ATA header plus 512 bytes of SMART */
++	if (n < 512 + (&p->data[0] - (uchar *) p))
++		exit(EXIT_FAILURE);
+ 	if (show_smart_regs(p) != 0)
+ 		exit(EXIT_FAILURE);
+ 	if (s->data & SmartDataRet) {

+ 4 - 0
debian/patches/series

@@ -1,3 +1,7 @@
+
+# cherry-picked commits. Keep in upstream's chronological order
+cherry-pick/1434503415.aoetools-36-2-ge50247f.check-amount-of-data-read-from-network-before-using-it.patch
+
 01_no_bashisms.patch
 02_no_hyphen_in_manpages.patch
 03_enable_hardened_build.patch