CVE-2014-3710.patch 720 B

1234567891011121314151617181920212223242526
  1. From 39c7ac1106be844a5296d3eb5971946cc09ffda0 Mon Sep 17 00:00:00 2001
  2. From: Christos Zoulas <christos@zoulas.com>
  3. Date: Fri, 17 Oct 2014 15:49:00 +0000
  4. Subject: [PATCH] Fix note bounds reading, Francisco Alonso / Red Hat
  5. diff --git a/src/readelf.c b/src/readelf.c
  6. index 08f81f5..9ebdebd 100644
  7. --- a/src/readelf.c
  8. +++ b/src/readelf.c
  9. @@ -477,6 +477,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
  10. uint32_t namesz, descsz;
  11. unsigned char *nbuf = CAST(unsigned char *, vbuf);
  12. + if (xnh_sizeof + offset > size) {
  13. + /*
  14. + * We're out of note headers.
  15. + */
  16. + return xnh_sizeof + offset;
  17. + }
  18. +
  19. (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
  20. offset += xnh_sizeof;
  21. --
  22. 1.7.10.4