Index: kernel/arch/ia32/include/arch/interrupt.h
===================================================================
--- kernel/arch/ia32/include/arch/interrupt.h	(revision ae7d03c05f24b857bbbdbcf3dafbf8ecc6c286ab)
+++ kernel/arch/ia32/include/arch/interrupt.h	(revision 8a1be7692f8710c1044d21f081dc5cffc0d5c33d)
@@ -51,4 +51,5 @@
 
 #define EXC_DE 0
+#define EXC_DB 1
 #define EXC_NM 7
 #define EXC_SS 12
@@ -73,4 +74,5 @@
 
 #define VECTOR_DE                 (IVT_EXCBASE + EXC_DE)
+#define VECTOR_DB                 (IVT_EXCBASE + EXC_DB)
 #define VECTOR_NM                 (IVT_EXCBASE + EXC_NM)
 #define VECTOR_SS                 (IVT_EXCBASE + EXC_SS)
Index: kernel/arch/ia32/src/interrupt.c
===================================================================
--- kernel/arch/ia32/src/interrupt.c	(revision ae7d03c05f24b857bbbdbcf3dafbf8ecc6c286ab)
+++ kernel/arch/ia32/src/interrupt.c	(revision 8a1be7692f8710c1044d21f081dc5cffc0d5c33d)
@@ -112,4 +112,14 @@
 }
 
+static void db_exception(unsigned int n, istate_t *istate)
+{
+	/*
+	 * We need to provide at least an empty handler that does not panic
+	 * if the exception appears to come from the kernel because the
+	 * userspace can inject a kernel-level #DB after e.g. the SYSENTER
+	 * instruction if the EFLAGS.TF is set.
+	 */
+}
+
 /** General Protection Fault. */
 static void gp_fault(unsigned int n __attribute__((unused)), istate_t *istate)
@@ -231,4 +241,5 @@
 
 	exc_register(VECTOR_DE, "de_fault", true, (iroutine_t) de_fault);
+	exc_register(VECTOR_DB, "db_exc", true, (iroutine_t) db_exception);
 	exc_register(VECTOR_NM, "nm_fault", true, (iroutine_t) nm_fault);
 	exc_register(VECTOR_SS, "ss_fault", true, (iroutine_t) ss_fault);
