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