1434503415.aoetools-36-2-ge50247f.check-amount-of-data-read-from-network-before-using-it.patch 593 B

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