Brought over from 1.1.5:

Fix from Bruce Evans. There were missing sets of parantheses:

1. The checks for the standard data selectors were botched, so %ss == 0
   and probably %cs == 0 were allowed.  A fix is enclosed.  The checks
   for the standard selectors could be omitted without losing anything
   since the standard selectors pass the valid_ldt_sel() tests.
This commit is contained in:
dg 1994-09-15 10:52:46 +00:00
parent ac02e81647
commit 8f3e2f30f8
2 changed files with 10 additions and 10 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.61 1994/09/04 19:59:14 pst Exp $
* $Id: machdep.c,v 1.62 1994/09/14 23:55:53 wollman Exp $
*/
#include "npx.h"
@ -640,11 +640,11 @@ sigreturn(p, uap, retval)
#define null_sel(sel) \
(!ISLDT(sel) && IDXSEL(sel) == 0)
if ((scp->sc_cs&0xffff != _ucodesel && !valid_ldt_sel(scp->sc_cs)) ||
(scp->sc_ss&0xffff != _udatasel && !valid_ldt_sel(scp->sc_ss)) ||
(scp->sc_ds&0xffff != _udatasel && !valid_ldt_sel(scp->sc_ds) &&
if (((scp->sc_cs&0xffff) != _ucodesel && !valid_ldt_sel(scp->sc_cs)) ||
((scp->sc_ss&0xffff) != _udatasel && !valid_ldt_sel(scp->sc_ss)) ||
((scp->sc_ds&0xffff) != _udatasel && !valid_ldt_sel(scp->sc_ds) &&
!null_sel(scp->sc_ds)) ||
(scp->sc_es&0xffff != _udatasel && !valid_ldt_sel(scp->sc_es) &&
((scp->sc_es&0xffff) != _udatasel && !valid_ldt_sel(scp->sc_es) &&
!null_sel(scp->sc_es))) {
#ifdef DEBUG
printf("sigreturn: cs=0x%x ss=0x%x ds=0x%x es=0x%x\n",

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.61 1994/09/04 19:59:14 pst Exp $
* $Id: machdep.c,v 1.62 1994/09/14 23:55:53 wollman Exp $
*/
#include "npx.h"
@ -640,11 +640,11 @@ sigreturn(p, uap, retval)
#define null_sel(sel) \
(!ISLDT(sel) && IDXSEL(sel) == 0)
if ((scp->sc_cs&0xffff != _ucodesel && !valid_ldt_sel(scp->sc_cs)) ||
(scp->sc_ss&0xffff != _udatasel && !valid_ldt_sel(scp->sc_ss)) ||
(scp->sc_ds&0xffff != _udatasel && !valid_ldt_sel(scp->sc_ds) &&
if (((scp->sc_cs&0xffff) != _ucodesel && !valid_ldt_sel(scp->sc_cs)) ||
((scp->sc_ss&0xffff) != _udatasel && !valid_ldt_sel(scp->sc_ss)) ||
((scp->sc_ds&0xffff) != _udatasel && !valid_ldt_sel(scp->sc_ds) &&
!null_sel(scp->sc_ds)) ||
(scp->sc_es&0xffff != _udatasel && !valid_ldt_sel(scp->sc_es) &&
((scp->sc_es&0xffff) != _udatasel && !valid_ldt_sel(scp->sc_es) &&
!null_sel(scp->sc_es))) {
#ifdef DEBUG
printf("sigreturn: cs=0x%x ss=0x%x ds=0x%x es=0x%x\n",