xfree86: Remove xf86InterceptSignals

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@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Adam Jackson 2017-11-20 15:43:04 -05:00
parent 722c8035dc
commit 0a255dceb7
3 changed files with 1 additions and 27 deletions

View File

@ -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);

View File

@ -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 */
}

View File

@ -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: