CVE-2024-57258-3.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 37095a204127b60b5e00c4c5d435d6e48a6a1c51 Mon Sep 17 00:00:00 2001
  2. From: Richard Weinberger <richard@nod.at>
  3. Date: Fri, 2 Aug 2024 12:08:43 +0200
  4. Subject: [PATCH 7/8] x86: Fix ptrdiff_t for x86_64
  5. sbrk() assumes ptrdiff_t is large enough to enlarge/shrink the heap
  6. by LONG_MIN/LONG_MAX.
  7. So, use the long type, also to match the rest of the Linux ecosystem.
  8. Signed-off-by: Richard Weinberger <richard@nod.at>
  9. Reviewed-by: Simon Glass <sjg@chromium.org>
  10. CVE: CVE-2024-57258
  11. Upstream-Status: Backport [https://source.denx.de/u-boot/u-boot/-/commit/c17b2a05dd50a3ba437e6373093a0d6a359cdee0]
  12. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  13. ---
  14. arch/x86/include/asm/posix_types.h | 3 ++-
  15. 1 file changed, 2 insertions(+), 1 deletion(-)
  16. diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h
  17. index dbcea7f4..e1ed9bca 100644
  18. --- a/arch/x86/include/asm/posix_types.h
  19. +++ b/arch/x86/include/asm/posix_types.h
  20. @@ -20,11 +20,12 @@ typedef unsigned short __kernel_gid_t;
  21. #if defined(__x86_64__)
  22. typedef unsigned long __kernel_size_t;
  23. typedef long __kernel_ssize_t;
  24. +typedef long __kernel_ptrdiff_t;
  25. #else
  26. typedef unsigned int __kernel_size_t;
  27. typedef int __kernel_ssize_t;
  28. -#endif
  29. typedef int __kernel_ptrdiff_t;
  30. +#endif
  31. typedef long __kernel_time_t;
  32. typedef long __kernel_suseconds_t;
  33. typedef long __kernel_clock_t;
  34. --
  35. 2.34.1