kernel/arm: send SIGSEGV to processes
On second thought, handle unknown faults caused by processes by sending SIGSEGV to them instead of bringing the whole system to a grind. Change-Id: Ieed5bb06910ab0c8eef1e68b0b4eec680867acd3
This commit is contained in:
parent
729a263d5f
commit
94ec38dc78
@ -116,25 +116,27 @@ data_abort(int is_nested, struct proc *pr, reg_t *saved_lr,
|
|||||||
/* Extract fault status bit [0:3, 10] from DFSR */
|
/* Extract fault status bit [0:3, 10] from DFSR */
|
||||||
u32_t fs = dfsr & 0x0F;
|
u32_t fs = dfsr & 0x0F;
|
||||||
fs |= ((dfsr >> 6) & 0x10);
|
fs |= ((dfsr >> 6) & 0x10);
|
||||||
if (is_alignment_fault(fs)) {
|
|
||||||
if (is_nested) {
|
/* Translation and permission faults are handled as pagefaults. */
|
||||||
printf("KERNEL: alignment fault dfar=0x%lx\n", dfar);
|
if (is_trans_fault(fs) || is_perm_fault(fs)) {
|
||||||
inkernel_disaster(pr, saved_lr, ep, is_nested);
|
|
||||||
}
|
|
||||||
/* Send SIGBUS to violating process. */
|
|
||||||
cause_sig(proc_nr(pr), SIGBUS);
|
|
||||||
return;
|
|
||||||
} else if (is_translation_fault(fs) || is_permission_fault(fs)) {
|
|
||||||
/* Ask VM to handle translation and permission faults as pagefaults */
|
|
||||||
pagefault(pr, saved_lr, is_nested, dfar, dfsr);
|
pagefault(pr, saved_lr, is_nested, dfar, dfsr);
|
||||||
return;
|
} else if (!is_nested) {
|
||||||
} else {
|
/* A user process caused some other kind of data abort. */
|
||||||
/* Die on unknown things... */
|
int signum = SIGSEGV;
|
||||||
printf("KERNEL: unhandled data abort dfar=0x%lx dfsr=0x%lx "
|
|
||||||
"fs=0x%lx is_nested=%d\n", dfar, dfsr, fs, is_nested);
|
if (is_align_fault(fs)) {
|
||||||
panic("unhandled data abort");
|
signum = SIGBUS;
|
||||||
|
} else {
|
||||||
|
printf("KERNEL: unknown data abort by proc %d sending "
|
||||||
|
"SIGSEGV (dfar=0x%lx dfsr=0x%lx fs=0x%lx)\n",
|
||||||
|
proc_nr(pr), dfar, dfsr, fs);
|
||||||
|
}
|
||||||
|
cause_sig(proc_nr(pr), signum);
|
||||||
|
} else { /* is_nested */
|
||||||
|
printf("KERNEL: inkernel data abort - disaster (dfar=0x%lx "
|
||||||
|
"dfsr=0x%lx fs=0x%lx)\n", dfar, dfsr, fs);
|
||||||
|
inkernel_disaster(pr, saved_lr, ep, is_nested);
|
||||||
}
|
}
|
||||||
NOT_REACHABLE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void inkernel_disaster(struct proc *saved_proc,
|
static void inkernel_disaster(struct proc *saved_proc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user