Skip to contentSkip to conversation

xen/arm: traps: Don't panic when receiving an unknown debug trap

PATCH In review Julien Grall 4 participants 5 messages Nov 5, 2020 – Nov 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: traps: Don't panic when receiving an unknown debug trap

From: Julien Grall <[email protected]>

Even if debug trap are only meant for debugging purpose, it is quite harsh to crash Xen if one of the trap sent by the guest is not handled.

So switch from a panic() to a printk().

---
 xen/arch/arm/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/traps.c +1 -1
index 8f40d0e0b6b1..a36f145e6739 100644
@@ -1410,7 +1410,7 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
         show_execution_state(regs);
         break;
     default:
-        panic("DOM%d: Unhandled debug trap %#x\n", domid, code);
+        printk("DOM%d: Unhandled debug trap %#x\n", domid, code);
         break;
     }
 }
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Julien Grall

Even if debug trap are only meant for debugging purpose, it is quite harsh to crash Xen if one of the trap sent by the guest is not handled.

So switch from a panic() to a printk().

Might this qualify as security due to potential DoS?

Signature · 4 lines
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         [email protected]  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
#2 lore raw
Quoted 7 lines · Elliott Mitchell
Quoted 4 lines · Julien Grall

Even if debug trap are only meant for debugging purpose, it is quite harsh to crash Xen if one of the trap sent by the guest is not handled.

So switch from a panic() to a printk().

Might this qualify as security due to potential DoS?

This code path only exists with CONFIG_DEBUG=y which is not security supported.

Cheers,

Signature · 1 line
Julien Grall
Reviewed-by on v1 1/1
#3 lore raw
In reply to Julien Grall
Quoted 8 lines · Julien Grall

From: Julien Grall <[email protected]>

Even if debug trap are only meant for debugging purpose, it is quite harsh to crash Xen if one of the trap sent by the guest is not handled.

So switch from a panic() to a printk().

Quoted 20 lines
---
 xen/arch/arm/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/traps.c +1 -1
index 8f40d0e0b6b1..a36f145e6739 100644
@@ -1410,7 +1410,7 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
         show_execution_state(regs);
         break;
     default:
-        panic("DOM%d: Unhandled debug trap %#x\n", domid, code);
+        printk("DOM%d: Unhandled debug trap %#x\n", domid, code);
         break;
     }
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#4 lore raw
In reply to Julien Grall

Hi Julien,

Quoted 8 lines · Julien Grall

From: Julien Grall <[email protected]>

Even if debug trap are only meant for debugging purpose, it is quite harsh to crash Xen if one of the trap sent by the guest is not handled.

So switch from a panic() to a printk().

Very smart idea :-)

Quoted 2 lines

Cheers
Bertrand

Quoted 21 lines

---
xen/arch/arm/traps.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/traps.c +1 -1
index 8f40d0e0b6b1..a36f145e6739 100644
@@ -1410,7 +1410,7 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
        show_execution_state(regs);
        break;
    default:
-        panic("DOM%d: Unhandled debug trap %#x\n", domid, code);
+        printk("DOM%d: Unhandled debug trap %#x\n", domid, code);
        break;
    }
 }
Signature · 1 line
2.17.1