CVE-2014-0207.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Subject: The cdf_read_short_sector function allows remote attackers to cause a denial of service
  2. ID: CVE-2014-0207
  3. Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Mon May 5 16:11:21 2014 +0000
  5. Origin:
  6. commit 6d209c1c489457397a5763bca4b28e43aac90391
  7. Debian-Author: Holger Levsen <holger@debian.org>
  8. Comment:
  9. made apply cleanly based on [origin], removed all modifications to
  10. src/readcdf.c (for CVE-2012-1571) as the problematic code was
  11. introduced later.
  12. Reviewed-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  13. Last-Update: 2014-09-07
  14. Apply patches from file-CVE-2012-1571.patch
  15. From Francisco Alonso Espejo:
  16. file < 5.18/git version can be made to crash when checking some
  17. corrupt CDF files (Using an invalid cdf_read_short_sector size)
  18. The problem I found here, is that in most situations (if
  19. h_short_sec_size_p2 > 8) because the blocksize is 512 and normal
  20. values are 06 which means reading 64 bytes.As long as the check
  21. for the block size copy is not checked properly (there's an assert
  22. that makes wrong/invalid assumptions)
  23. --- a/src/cdf.c
  24. +++ b/src/cdf.c
  25. @@ -355,10 +355,10 @@
  26. size_t ss = CDF_SHORT_SEC_SIZE(h);
  27. size_t pos = CDF_SHORT_SEC_POS(h, id);
  28. assert(ss == len);
  29. - if (pos > CDF_SEC_SIZE(h) * sst->sst_len) {
  30. + if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
  31. DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
  32. SIZE_T_FORMAT "u\n",
  33. - pos, CDF_SEC_SIZE(h) * sst->sst_len));
  34. + pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
  35. return -1;
  36. }
  37. (void)memcpy(((char *)buf) + offs,