CVE-2014-8116.2.d7cdad0.patch 846 B

1234567891011121314151617181920212223242526272829303132333435
  1. Subject: Stop reporting bad capabilities after the first few
  2. ID: CVE-2014-8116
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Sat Nov 22 23:57:44 2014 +0000
  5. Origin: FILE5_20-28-gd7cdad0
  6. Last-Update: 2015-01-09
  7. --- a/src/readelf.c
  8. +++ b/src/readelf.c
  9. @@ -859,6 +859,7 @@
  10. Elf32_Shdr sh32;
  11. Elf64_Shdr sh64;
  12. int stripped = 1;
  13. + size_t nbadcap = 0;
  14. void *nbuf;
  15. off_t noff;
  16. uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
  17. @@ -936,6 +937,8 @@
  18. file_badread(ms);
  19. return -1;
  20. }
  21. + if (nbadcap > 5)
  22. + break;
  23. if (lseek(fd, (off_t)xsh_offset, SEEK_SET) ==
  24. (off_t)-1) {
  25. file_badread(ms);
  26. @@ -971,6 +974,8 @@
  27. (unsigned long long)xcap_tag,
  28. (unsigned long long)xcap_val) == -1)
  29. return -1;
  30. + if (nbadcap++ > 2)
  31. + coff = xsh_size;
  32. break;
  33. }
  34. }