|
|
c35cd3 |
Upstream patch from https://github.com/libuv/libuv/pull/2966
|
|
|
c35cd3 |
to address https://bugzilla.redhat.com/show_bug.cgi?id=1879330
|
|
|
c35cd3 |
Resolves: #CVE-2020-8252
|
|
|
c35cd3 |
|
|
|
c35cd3 |
From 0e6e8620496dff0eb285589ef1e37a7f407f3ddd Mon Sep 17 00:00:00 2001
|
|
|
c35cd3 |
From: Ben Noordhuis <info@bnoordhuis.nl>
|
|
|
c35cd3 |
Date: Mon, 24 Aug 2020 11:42:27 +0200
|
|
|
c35cd3 |
Subject: unix: don't use _POSIX_PATH_MAX
|
|
|
c35cd3 |
|
|
|
c35cd3 |
Libuv was using _POSIX_PATH_MAX wrong. Bug introduced in commit b56d279b
|
|
|
c35cd3 |
("unix: do not require PATH_MAX to be defined") from September 2018.
|
|
|
c35cd3 |
|
|
|
c35cd3 |
_POSIX_PATH_MAX is the minimum max path size guaranteed by POSIX, not
|
|
|
c35cd3 |
the actual max path size of the system libuv runs on. _POSIX_PATH_MAX
|
|
|
c35cd3 |
is always 256, the real max is often much bigger.
|
|
|
c35cd3 |
|
|
|
c35cd3 |
This commit fixes buffer overruns when processing very long paths in
|
|
|
c35cd3 |
uv_fs_readlink() and uv_fs_realpath() because libuv was not allocating
|
|
|
c35cd3 |
enough memory to store the result.
|
|
|
c35cd3 |
|
|
|
c35cd3 |
Fixes: https://github.com/libuv/libuv/issues/2965
|
|
|
c35cd3 |
PR-URL: https://github.com/libuv/libuv/pull/2966
|
|
|
c35cd3 |
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
|
|
|
c35cd3 |
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
|
|
|
c35cd3 |
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
|
|
c35cd3 |
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
|
|
|
c35cd3 |
---
|
|
|
c35cd3 |
src/unix/internal.h | 4 +---
|
|
|
c35cd3 |
1 file changed, 1 insertion(+), 3 deletions(-)
|
|
|
c35cd3 |
|
|
|
c35cd3 |
diff --git a/src/unix/internal.h b/src/unix/internal.h
|
|
|
c35cd3 |
index 30711673..9d3c2297 100644
|
|
|
c35cd3 |
--- a/src/unix/internal.h
|
|
|
c35cd3 |
+++ b/src/unix/internal.h
|
|
|
c35cd3 |
@@ -62,9 +62,7 @@
|
|
|
c35cd3 |
# include <AvailabilityMacros.h>
|
|
|
c35cd3 |
#endif
|
|
|
c35cd3 |
|
|
|
c35cd3 |
-#if defined(_POSIX_PATH_MAX)
|
|
|
c35cd3 |
-# define UV__PATH_MAX _POSIX_PATH_MAX
|
|
|
c35cd3 |
-#elif defined(PATH_MAX)
|
|
|
c35cd3 |
+#if defined(PATH_MAX)
|
|
|
c35cd3 |
# define UV__PATH_MAX PATH_MAX
|
|
|
c35cd3 |
#else
|
|
|
c35cd3 |
# define UV__PATH_MAX 8192
|
|
|
c35cd3 |
--
|
|
|
c35cd3 |
2.26.2
|
|
|
c35cd3 |
|