Changeset ae89656 in mainline for kernel/arch/ia32/src/interrupt.c


Ignore:
Timestamp:
2018-05-11T17:26:58Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7473807
Parents:
8a8771c
Message:

Provide an empty #DB handler

Userspace can trigger a #DB exception just after the SYSENTER
instruction by setting the TF in EFLAGS. The #DB exception will appear
to have originated in the kernel so we must not panic in that case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/interrupt.c

    r8a8771c rae89656  
    112112}
    113113
     114static void db_exception(unsigned int n, istate_t *istate)
     115{
     116        /*
     117         * We need to provide at least an empty handler that does not panic
     118         * if the exception appears to come from the kernel because the
     119         * userspace can inject a kernel-level #DB after e.g. the SYSENTER
     120         * instruction if the EFLAGS.TF is set.
     121         */
     122}
     123
    114124/** General Protection Fault. */
    115125static void gp_fault(unsigned int n __attribute__((unused)), istate_t *istate)
     
    231241
    232242        exc_register(VECTOR_DE, "de_fault", true, (iroutine_t) de_fault);
     243        exc_register(VECTOR_DB, "db_exc", true, (iroutine_t) db_exception);
    233244        exc_register(VECTOR_NM, "nm_fault", true, (iroutine_t) nm_fault);
    234245        exc_register(VECTOR_SS, "ss_fault", true, (iroutine_t) ss_fault);
Note: See TracChangeset for help on using the changeset viewer.