All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap
@ 2020-11-05 22:31 Julien Grall
  2020-11-05 23:10 ` Elliott Mitchell
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Julien Grall @ 2020-11-05 22:31 UTC (permalink / raw)
  To: xen-devel; +Cc: julien, Julien Grall, Stefano Stabellini, Volodymyr Babchuk

From: Julien Grall <jgrall@amazon.com>

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().

Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 8f40d0e0b6b1..a36f145e6739 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -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;
     }
 }
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap
  2020-11-05 22:31 [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap Julien Grall
@ 2020-11-05 23:10 ` Elliott Mitchell
  2020-11-05 23:11   ` Julien Grall
  2020-11-06  1:59 ` Stefano Stabellini
  2020-11-06  7:46 ` Bertrand Marquis
  2 siblings, 1 reply; 5+ messages in thread
From: Elliott Mitchell @ 2020-11-05 23:10 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Julien Grall, Stefano Stabellini, Volodymyr Babchuk

On Thu, Nov 05, 2020 at 10:31:06PM +0000, Julien Grall wrote:
> 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?


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap
  2020-11-05 23:10 ` Elliott Mitchell
@ 2020-11-05 23:11   ` Julien Grall
  0 siblings, 0 replies; 5+ messages in thread
From: Julien Grall @ 2020-11-05 23:11 UTC (permalink / raw)
  To: Elliott Mitchell
  Cc: xen-devel, Julien Grall, Stefano Stabellini, Volodymyr Babchuk



On 05/11/2020 23:10, Elliott Mitchell wrote:
> On Thu, Nov 05, 2020 at 10:31:06PM +0000, Julien Grall wrote:
>> 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,

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap
  2020-11-05 22:31 [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap Julien Grall
  2020-11-05 23:10 ` Elliott Mitchell
@ 2020-11-06  1:59 ` Stefano Stabellini
  2020-11-06  7:46 ` Bertrand Marquis
  2 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2020-11-06  1:59 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Julien Grall, Stefano Stabellini, Volodymyr Babchuk

On Thu, 5 Nov 2020, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> 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().
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  xen/arch/arm/traps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 8f40d0e0b6b1..a36f145e6739 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -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;
>      }
>  }
> -- 
> 2.17.1
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap
  2020-11-05 22:31 [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap Julien Grall
  2020-11-05 23:10 ` Elliott Mitchell
  2020-11-06  1:59 ` Stefano Stabellini
@ 2020-11-06  7:46 ` Bertrand Marquis
  2 siblings, 0 replies; 5+ messages in thread
From: Bertrand Marquis @ 2020-11-06  7:46 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Julien Grall, Stefano Stabellini, Volodymyr Babchuk

Hi Julien,

> On 5 Nov 2020, at 22:31, Julien Grall <julien@xen.org> wrote:
> 
> From: Julien Grall <jgrall@amazon.com>
> 
> 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 :-)

> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/traps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 8f40d0e0b6b1..a36f145e6739 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -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;
>     }
> }
> -- 
> 2.17.1
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-06  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 22:31 [PATCH] xen/arm: traps: Don't panic when receiving an unknown debug trap Julien Grall
2020-11-05 23:10 ` Elliott Mitchell
2020-11-05 23:11   ` Julien Grall
2020-11-06  1:59 ` Stefano Stabellini
2020-11-06  7:46 ` Bertrand Marquis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.