[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 5/7] xen/arm: traps: Avoid BUG_ON() in do_trap_brk()


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 26 Jul 2019 12:38:00 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=epam.com;dmarc=pass action=none header.from=epam.com;dkim=pass header.d=epam.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rvz5vPKTu9agTW5zKiIEAVKqfBPNIJKml6Kxtby7vSE=; b=MCR9HKfprucA2duZHtALWYBjKhDdEzs3yCQvibrXJ6IOm06ardNEWQ182/sJoFo+H5Cvk6ttfhtCMLLTcYr+OMjrnkiR/wVnFN4JHgjmCX88tVTmdiKM8Gl+qnA1EjxKDPx1OrCMXUS+1ctKsk8if/QpRuq97c0XCTG4gi3vt3A1RYpfUXcBgzw0Ws3NJqaK7/QnpZ0sXoKjMVJP+1CPLMThMhHrqPjWrEXDfjWUGGe5lQ9elmFBTPg0lPyo9r4XFrUocHfUNZPCrLhzQuWDddfzO4TxIRsH8njIx9DroBoli/Pq5+c92TeLPq0ka8h4eOPzDVv5XYgrCIrSoruh6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LVVr4ZorwVefKLJi6o1fmsV6Pdl++XYD1Fkitk1h6uq0SekSn4IMFeHTrH6s/tFYdJjimt9D91YnFsNpHxjlfgAwvXy5b1WYGwYwahD2PNe8ojPGOYleTasexdDcGK4Ge9NQ9ztryH5RghGZX4emdH7WLql1wTmPlsacD38aGNPD89UzbTH9xk9nTrWZ/T5rokboZgnOXZvajnUSBg/ozBVs7lgjgIH7jPI0mU+7HAICFEwk1ST5k8H2E7FSlsSA+nl+kMWzCL3z/uW2dYdugkruQt4s/IhOumUGZTaO9HzgI4Iy6xVgLKcjKI4dDRO5mlqTXcREhuJGX+Q8F0znuA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 26 Jul 2019 12:38:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQZ6k8qwLfZd6ak+FKyeZYDhv0qbc2qsA
  • Thread-topic: [PATCH 5/7] xen/arm: traps: Avoid BUG_ON() in do_trap_brk()

Julien Grall writes:

> At the moment, do_trap_brk() is using a BUG_ON() to check the hardware
> has been correctly configured during boot.
>
> Any error when configuring the hardware could result to a guest 'brk'
> trapping in the hypervisor and crash it.
>
> This is pretty harsh to kill Xen when actually killing the guest would
> be enough as misconfiguring this trap would not lead to exposing
> sensitive data. Replace the BUG_ON() with crashing the guest.
>
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

> ---
>  xen/arch/arm/traps.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 132686ee0f..ef37ca6bde 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1304,10 +1304,15 @@ int do_bug_frame(const struct cpu_user_regs *regs, 
> vaddr_t pc)
>  #ifdef CONFIG_ARM_64
>  static void do_trap_brk(struct cpu_user_regs *regs, const union hsr hsr)
>  {
> -    /* HCR_EL2.TGE and MDCR_EL2.TDE are not set so we never receive
> -     * software breakpoint exception for EL1 and EL0 here.
> +    /*
> +     * HCR_EL2.TGE and MDCR_EL2.TDR are currently not set. So we should
> +     * never receive software breakpoing exception for EL1 and EL0 here.
>       */
> -    BUG_ON(!hyp_mode(regs));
> +    if ( !hyp_mode(regs) )
> +    {
> +        domain_crash(current->domain);
> +        return;
> +    }
>  
>      switch ( hsr.brk.comment )
>      {


-- 
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.