Blame SOURCES/0001-Disable-logfile-and-modulepath-when-running-with-ele.patch

9647e4
From 2fda7c57e7ebe210cf5e2bb051a0a9271f85e80a Mon Sep 17 00:00:00 2001
9647e4
From: Matthieu Herrb <matthieu@herrb.eu>
9647e4
Date: Mon, 22 Oct 2018 14:33:25 -0400
9647e4
Subject: [PATCH xserver] Disable -logfile and -modulepath when running with
9647e4
 elevated privileges
9647e4
9647e4
An unprivileged user was able to overwrite arbitrary files
9647e4
in directories in which it is able to chdir, potentially
9647e4
leading to privilege elevation.
9647e4
9647e4
CVE-2018-14665
9647e4
9647e4
An unprivileded user was able to load arbitrary modules
9647e4
from user controlled directories, leading to privilege
9647e4
elevation.
9647e4
9647e4
CVE-2018-XXXXX
9647e4
9647e4
Issues reported by Narendra Shinde
9647e4
9647e4
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
9647e4
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
9647e4
---
9647e4
 hw/xfree86/common/xf86Init.c | 8 ++++++--
9647e4
 1 file changed, 6 insertions(+), 2 deletions(-)
9647e4
9647e4
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
9647e4
index 6c25eda739..0f57efa863 100644
9647e4
--- a/hw/xfree86/common/xf86Init.c
9647e4
+++ b/hw/xfree86/common/xf86Init.c
9647e4
@@ -935,14 +935,18 @@ ddxProcessArgument(int argc, char **argv, int i)
9647e4
     /* First the options that are not allowed with elevated privileges */
9647e4
     if (!strcmp(argv[i], "-modulepath")) {
9647e4
         CHECK_FOR_REQUIRED_ARGUMENT();
9647e4
-        xf86CheckPrivs(argv[i], argv[i + 1]);
9647e4
+        if (xf86PrivsElevated())
9647e4
+              FatalError("\nInvalid argument -modulepath "
9647e4
+                "with elevated privileges\n");
9647e4
         xf86ModulePath = argv[i + 1];
9647e4
         xf86ModPathFrom = X_CMDLINE;
9647e4
         return 2;
9647e4
     }
9647e4
     if (!strcmp(argv[i], "-logfile")) {
9647e4
         CHECK_FOR_REQUIRED_ARGUMENT();
9647e4
-        xf86CheckPrivs(argv[i], argv[i + 1]);
9647e4
+        if (xf86PrivsElevated())
9647e4
+              FatalError("\nInvalid argument -logfile "
9647e4
+                "with elevated privileges\n");
9647e4
         xf86LogFile = argv[i + 1];
9647e4
         xf86LogFileFrom = X_CMDLINE;
9647e4
         return 2;
9647e4
-- 
9647e4
2.19.0
9647e4