SIGBUS is an alignment fault. SIGSEGV is an access violation
authorderaadt <deraadt@openbsd.org>
Fri, 12 Jan 1996 16:45:00 +0000 (16:45 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 12 Jan 1996 16:45:00 +0000 (16:45 +0000)
13 files changed:
sys/arch/alpha/alpha/trap.c
sys/arch/amiga/amiga/trap.c
sys/arch/atari/atari/trap.c
sys/arch/hp300/hp300/trap.c
sys/arch/i386/i386/locore.s
sys/arch/i386/i386/trap.c
sys/arch/mac68k/mac68k/trap.c
sys/arch/mvme68k/mvme68k/trap.c
sys/arch/mvme88k/mvme88k/trap.c
sys/arch/pc532/pc532/trap.c
sys/arch/pica/pica/trap.c
sys/arch/pmax/pmax/trap.c
sys/arch/sun3/sun3/trap.c

index fcea484..e1ec691 100644 (file)
@@ -295,7 +295,7 @@ sigfpe:             i = SIGFPE;
                        goto dopanic;
                }
                ucode = v;
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
 
index ee10468..cd6f281 100644 (file)
@@ -455,7 +455,7 @@ nogo:
                       type, code);
                panictrap(type, code, v, fp);
        }
-       trapsignal(p, (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV, v);
+       trapsignal(p, SIGSEGV, v);
        if ((type & T_USER) == 0)
                return;
        userret(p, fp->f_pc, sticks); 
index 9ccb593..7d6858d 100644 (file)
@@ -440,7 +440,7 @@ nogo:
                       type, code);
                panictrap(type, code, v, fp);
        }
-       trapsignal(p, (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV, v);
+       trapsignal(p, SIGSEGV, v);
        if ((type & T_USER) == 0)
                return;
        userret(p, fp->f_pc, sticks); 
index eb33b83..ebc9a5d 100644 (file)
@@ -564,7 +564,7 @@ copyfault:
                        goto dopanic;
                }
                ucode = v;
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
        }
@@ -819,22 +819,10 @@ writeback(fp, docachepush)
        }
        p->p_addr->u_pcb.pcb_onfault = oonfault;
        /*
-        * Determine the cause of the failure if any translating to
-        * a signal.  If the corresponding VA is valid and RO it is
-        * a protection fault (SIGBUS) otherwise consider it an
-        * illegal reference (SIGSEGV).
+        * Any problems are SIGSEGV's
         */
-       if (err) {
-               if (vm_map_check_protection(&p->p_vmspace->vm_map,      
-                                           trunc_page(fa), round_page(fa),
-                                           VM_PROT_READ) &&
-                   !vm_map_check_protection(&p->p_vmspace->vm_map,
-                                            trunc_page(fa), round_page(fa),
-                                            VM_PROT_WRITE))
-                       err = SIGBUS;
-               else
-                       err = SIGSEGV;
-       }
+       if (err)
+               err = SIGSEGV;
        return(err);
 }
 
index 3fe7773..97e36ba 100644 (file)
@@ -1887,7 +1887,7 @@ IDTVEC(align)
  * If an error is detected during trap, syscall, or interrupt exit, trap() will
  * change %eip to point to one of these labels.  We clean up the stack, if
  * necessary, and resume as if we were handling a general protection fault.
- * This will cause the process to get a SIGBUS.
+ * This will cause the process to get a SIGSEGV.
  */
 ENTRY(resume_iret)
        ZTRAP(T_PROTFLT)
index f6feb3f..c929d7e 100644 (file)
@@ -412,8 +412,7 @@ trap(frame)
                            map, va, ftype, rv);
                        goto we_re_toast;
                }
-               trapsignal(p, (rv == KERN_PROTECTION_FAILURE)
-                   ? SIGBUS : SIGSEGV, T_PAGEFLT);
+               trapsignal(p, SIGSEGV, T_PAGEFLT);
                break;
        }
 
index 97496cb..9798285 100644 (file)
@@ -548,7 +548,7 @@ copyfault:
                        goto dopanic;
                }
                ucode = v;
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
        }
@@ -803,22 +803,10 @@ writeback(fp, docachepush)
        }
        p->p_addr->u_pcb.pcb_onfault = oonfault;
        /*
-        * Determine the cause of the failure if any translating to
-        * a signal.  If the corresponding VA is valid and RO it is
-        * a protection fault (SIGBUS) otherwise consider it an
-        * illegal reference (SIGSEGV).
+        * Any problems are SIGSEGV's
         */
-       if (err) {
-               if (vm_map_check_protection(&p->p_vmspace->vm_map,      
-                                           trunc_page(fa), round_page(fa),
-                                           VM_PROT_READ) &&
-                   !vm_map_check_protection(&p->p_vmspace->vm_map,
-                                            trunc_page(fa), round_page(fa),
-                                            VM_PROT_WRITE))
-                       err = SIGBUS;
-               else
-                       err = SIGSEGV;
-       }
+       if (err)
+               err = SIGSEGV;
        return(err);
 }
 
index 3c81ef7..2b0e8fc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: trap.c,v 1.4 1995/11/23 13:14:31 deraadt Exp $ */
+/*     $Id: trap.c,v 1.5 1996/01/12 16:45:14 deraadt Exp $ */
 
 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -611,7 +611,7 @@ copyfault:
                        goto dopanic;
                }
                ucode = v;
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
        }
@@ -867,22 +867,10 @@ writeback(fp, docachepush)
        }
        p->p_addr->u_pcb.pcb_onfault = oonfault;
        /*
-        * Determine the cause of the failure if any translating to
-        * a signal.  If the corresponding VA is valid and RO it is
-        * a protection fault (SIGBUS) otherwise consider it an
-        * illegal reference (SIGSEGV).
+        * Any problems are SIGSEGV's
         */
-       if (err) {
-               if (vm_map_check_protection(&p->p_vmspace->vm_map,
-                                           trunc_page(fa), round_page(fa),
-                                           VM_PROT_READ) &&
-                   !vm_map_check_protection(&p->p_vmspace->vm_map,
-                                            trunc_page(fa), round_page(fa),
-                                            VM_PROT_WRITE))
-                       err = SIGBUS;
-               else
-                       err = SIGSEGV;
-       }
+       if (err)
+               err = SIGSEGV;
        return(err);
 }
 
index ebdf528..d399c35 100644 (file)
@@ -348,7 +348,7 @@ trap(unsigned type, struct m88100_saved_state *frame)
                    frame->snip = frame->sxip & ~NIP_E;
                }
        } else {
-               sig = result == KERN_PROTECTION_FAILURE ? SIGBUS : SIGSEGV;
+               sig = result == SIGSEGV;
        }
 
        break;
index d72213d..300ff78 100644 (file)
@@ -176,7 +176,7 @@ copyfault:
                 * APDEpde (or there may be no problem with APDEpde).
                 */
                if (va > 0xFEBFF000) {
-                       v = KERN_FAILURE;       /* becomes SIGBUS */
+                       v = KERN_FAILURE;       /* becomes SIGSEGV */
                        goto nogo;
                }
                /*
@@ -253,7 +253,7 @@ nogo:
                               type, tear, msr);
                        goto we_re_toast;
                }
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
 
index bf210a3..ce3e164 100644 (file)
@@ -38,7 +38,7 @@
  * from: Utah Hdr: trap.c 1.32 91/04/06
  *
  *     from: @(#)trap.c        8.5 (Berkeley) 1/11/94
- *      $Id: trap.c,v 1.3 1995/10/29 00:46:10 deraadt Exp $
+ *      $Id: trap.c,v 1.4 1996/01/12 16:45:19 deraadt Exp $
  */
 
 #include <sys/param.h>
@@ -429,7 +429,7 @@ trap(statusReg, causeReg, vadr, pc, args)
                        goto err;
                }
                ucode = vadr;
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
 
@@ -437,7 +437,7 @@ trap(statusReg, causeReg, vadr, pc, args)
        case T_ADDR_ERR_ST+T_USER:      /* misaligned or kseg access */
        case T_BUS_ERR_IFETCH+T_USER:   /* BERR asserted to cpu */
        case T_BUS_ERR_LD_ST+T_USER:    /* BERR asserted to cpu */
-               i = SIGSEGV;
+               i = SIGBUS;
                break;
 
        case T_SYSCALL+T_USER:
index d4b3cf1..50f6b02 100644 (file)
@@ -438,7 +438,7 @@ trap(statusReg, causeReg, vadr, pc, args)
                        goto err;
                }
                ucode = vadr;
-               i = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               i = SIGSEGV;
                break;
            }
 
@@ -446,7 +446,7 @@ trap(statusReg, causeReg, vadr, pc, args)
        case T_ADDR_ERR_ST+T_USER:      /* misaligned or kseg access */
        case T_BUS_ERR_IFETCH+T_USER:   /* BERR asserted to cpu */
        case T_BUS_ERR_LD_ST+T_USER:    /* BERR asserted to cpu */
-               i = SIGSEGV;
+               i = SIGBUS;
                break;
 
        case T_SYSCALL+T_USER:
index c2d6e2c..2470219 100644 (file)
@@ -522,7 +522,7 @@ trap(type, code, v, frame)
                        goto dopanic;
                }
                ucode = v;
-               sig = (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV;
+               sig = SIGSEGV;
                break;
        } /* T_MMUFLT */
        } /* switch */