File: 11_xfree86-Disable-logfile-and-modulepath.patch

package info (click to toggle)
xorg-server 2:1.19.2-1+deb9u5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,820 kB
  • sloc: ansic: 372,380; xml: 18,082; makefile: 3,482; objc: 3,470; sh: 813; python: 514; yacc: 483; cpp: 479; lex: 281; asm: 214; awk: 52; perl: 5
file content (39 lines) | stat: -rw-r--r-- 1,583 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Matthieu Herrb <matthieu@herrb.eu>
Date: Tue, 23 Oct 2018 21:29:08 +0200
Subject: [PATCH xserver] Disable -logfile and -modulepath when running with elevated privileges.

Could cause privilege elevation and/or arbitrary files overwrite, when
the X server is running with elevated privileges (ie when Xorg is
installed with the setuid bit set and started by a non-root user).

CVE-2018-14665

Issue reported by Narendra Shinde and Red Hat.

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

--- xorg-server.orig/hw/xfree86/common/xf86Init.c
+++ xorg-server/hw/xfree86/common/xf86Init.c
@@ -1134,14 +1134,18 @@ ddxProcessArgument(int argc, char **argv
     /* First the options that are not allowed with elevated privileges */
     if (!strcmp(argv[i], "-modulepath")) {
         CHECK_FOR_REQUIRED_ARGUMENT();
-        xf86CheckPrivs(argv[i], argv[i + 1]);
+        if (xf86PrivsElevated())
+              FatalError("\nInvalid argument -modulepath "
+                "with elevated privileges\n");
         xf86ModulePath = argv[i + 1];
         xf86ModPathFrom = X_CMDLINE;
         return 2;
     }
     if (!strcmp(argv[i], "-logfile")) {
         CHECK_FOR_REQUIRED_ARGUMENT();
-        xf86CheckPrivs(argv[i], argv[i + 1]);
+        if (xf86PrivsElevated())
+              FatalError("\nInvalid argument -logfile "
+                "with elevated privileges\n");
         xf86LogFile = argv[i + 1];
         xf86LogFileFrom = X_CMDLINE;
         return 2;