[PATCH xserver 2/6] xfree86: Remove xf86InterceptSignals

Adam Jackson ajax at redhat.com
Mon Nov 20 20:43:04 UTC 2017


The only consumer of this is the Linux vm86 backend for int10 (which you
should not use), and there all it serves to do is make signals generated
by the vm86 task non-fatal. In practice this error appears never to
happen, and marching ahead with root privileges after arbitrary code has
raised a signal seems like a poor plan.

Remove the usage in the vm86 code, making this error fatal.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/common/xf86.h                            |  1 -
 hw/xfree86/common/xf86Events.c                      | 14 --------------
 hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c | 13 +------------
 3 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index db6e299b31..43b693143e 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -215,7 +215,6 @@ extern _X_EXPORT void xf86DisableGeneralHandler(void *handler);
 extern _X_EXPORT void xf86EnableGeneralHandler(void *handler);
 extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
                                                         handler, void *data);
-extern _X_EXPORT void xf86InterceptSignals(int *signo);
 extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
 extern _X_EXPORT void xf86PrintBacktrace(void);
 extern _X_EXPORT Bool xf86VTOwner(void);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index e2e6ca7691..a27c7ff1b0 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -267,15 +267,6 @@ xf86RemoveEnabledDevice(InputInfoPtr pInfo)
     InputThreadUnregisterDev(pInfo->fd);
 }
 
-static int *xf86SignalIntercept = NULL;
-
-void
-xf86InterceptSignals(int *signo)
-{
-    if ((xf86SignalIntercept = signo))
-        *signo = -1;
-}
-
 /*
  * xf86SigWrapper --
  *    Catch unexpected signals and exit or continue cleanly.
@@ -283,11 +274,6 @@ xf86InterceptSignals(int *signo)
 int
 xf86SigWrapper(int signo)
 {
-    if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
-        *xf86SignalIntercept = signo;
-        return 0;               /* continue */
-    }
-
     xf86Info.caughtSignal = TRUE;
     return 1;                   /* abort */
 }
diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
index 1876983991..134809814f 100644
--- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
+++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
@@ -231,20 +231,9 @@ vm86_GP_fault(xf86Int10InfoPtr pInt)
 static int
 do_vm86(xf86Int10InfoPtr pInt)
 {
-    int retval, signo;
+    int retval;
 
-    xf86InterceptSignals(&signo);
     retval = vm86_rep(VM86S);
-    xf86InterceptSignals(NULL);
-
-    if (signo >= 0) {
-        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
-                   "vm86() syscall generated signal %d.\n", signo);
-        dump_registers(pInt);
-        dump_code(pInt);
-        stack_trace(pInt);
-        return 0;
-    }
 
     switch (VM86_TYPE(retval)) {
     case VM86_UNKNOWN:
-- 
2.14.3



More information about the xorg-devel mailing list