I have no clue at all. That's a very good question. Here's a snipet of code
from arch/i386/fault.c:
bad_area:
up(&mm->mmap_sem);
/* User mode accesses just cause a SIGSEGV */
if (error_code & 4) {
tsk->tss.cr2 = address;
tsk->tss.error_code = error_code;
tsk->tss.trap_no = 14;
force_sig(SIGSEGV, tsk);
goto out;
}
/* Are we prepared to handle this kernel fault? */
if ((fixup = search_exception_table(regs->eip)) != 0) {
printk(KERN_DEBUG "%s: Exception at [<%lx>] (%lx)\n",
tsk->comm,
regs->eip,
fixup);
regs->eip = fixup;
goto out;
}
I don't quite know the answer. It looks like only kernel faults send the
KERN_DEBUG "Exception" spam out to the syslog. It also "fixes" it somehow.
It seems that what it's doing is doing some run-time modification of the
execution path to skip over the invalid instruction.
I apparently understand the fault mechanism properly, but don't understand
exactly why it behaves like it does. I think I've just stepped beyond my
knowledge. I'm sending a copy of this back to the kernel list in the hope
that some of the gurus can better answer this. I hope you don't mind.