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

Re: [PATCH] xen: Fix incorrect taint constant


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 5 Jun 2023 10:29:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EKq8+07ExRSA2xea1BXtN/n8cB6r10q4EkwGt/WfaNw=; b=iXyzb4c+mMuP4jLySKxAaTfUfhtBaVkGGHBKZrmWcQnqnz9/x5ul0d1RoeFi8+U/51cZgRy7evhOwO+lIdZArnWKMkRCC0/h0a5khWvVyO0MQMPRvs/V3rnrJ+lzw3QugFz33Ctzk71fxEhMpx0QFL9FZeah4S9JlK4dl85uSIZlrzhev8c0mWVGoPSJtOcueHYYNJXYMdXKLhLzx7E1Z03mZPFKvOCTesilLun4vOwUZ35c24PiTukbaYlt84kMfKe6zkpi8zBeu22CCjxnWHHbWbhtSyVK/y8TLGa+oCmerhWw+7mb/g9XIBHU2WWzcXwJptTa6uyx8dm3FVPczA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eoCxC3RvnDKvHtlgASVI+5Sq5bp89xjE6LKbVah48nJLJWA+sLfSzlZnMSPsXwXP3XwmgHdE5GVeuDGbFyPxvftUw++Sq9QGUg6Cd1ePgckHvkUkUP0PrLofMxabyWCXNz/73uk0oHj3Rc4vc0kSpIJkL0G6Rvd6vTFjuuYDK506nDUQb4SuDCIkUz2kmQnGKQp6pEzdwvXy/hVA5tdfJ+7s6aG2wG348ld2GGnvIjzxU+tooocWJbT+lMjiZqM4NQZvbthOMJC3YQ5Bhd6Dtx+uyLr2MtYf7QNr1aDV9fX1NQYcrqt5Cyk9903aB9CpHzpJDqnQTEC1UhjqQ49jdg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 05 Jun 2023 10:29:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZl5VEGEwt80GVFUeB/y+61w4aBa98Ae8A
  • Thread-topic: [PATCH] xen: Fix incorrect taint constant

Hi Andrew,

> On 5 Jun 2023, at 12:05, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> Insecure the word being looked for here.  Especially given the nature of the
> sole caller, and the (correct) comment next to it.

Good finding.

> 
> I've left the taint constant as 'U' as it's a rather more user-visible.

I would vote to change the U in I here as it will make it more coherent
with the doc after your added fix for it.

> 
> Fixes: 82c0d3d491cc ("xen: Add an unsecure Taint type")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> CC: Julien Grall <julien@xxxxxxx>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> 
> I'm happy to change 'U' to 'I' if we think that no-one is going to be impacted
> by it.  I just wasn't sure.

Here i do not think many will be impacted so I would rather make this coherent.

Cheers
Bertrand


> ---
> xen/arch/arm/cpuerrata.c | 2 +-
> xen/common/kernel.c      | 2 +-
> xen/include/xen/lib.h    | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
> index 1abacfe5bb67..d0658aedb6aa 100644
> --- a/xen/arch/arm/cpuerrata.c
> +++ b/xen/arch/arm/cpuerrata.c
> @@ -695,7 +695,7 @@ void __init enable_errata_workarounds(void)
>                     "**** Only trusted guests should be used.                 
>             ****\n");
> 
>         /* Taint the machine has being insecure */
> -        add_taint(TAINT_MACHINE_UNSECURE);
> +        add_taint(TAINT_MACHINE_INSECURE);
>     }
> #endif
> }
> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
> index f7b1f65f373c..14ce6b40ce06 100644
> --- a/xen/common/kernel.c
> +++ b/xen/common/kernel.c
> @@ -354,7 +354,7 @@ char *print_tainted(char *str)
>     if ( tainted )
>     {
>         snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c%c",
> -                 tainted & TAINT_MACHINE_UNSECURE ? 'U' : ' ',
> +                 tainted & TAINT_MACHINE_INSECURE ? 'U' : ' ',
>                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
>                  tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
>                  tainted & TAINT_ERROR_INJECT ? 'E' : ' ',
> diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
> index e914ccade095..75ae7489b9f0 100644
> --- a/xen/include/xen/lib.h
> +++ b/xen/include/xen/lib.h
> @@ -201,7 +201,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
> #define TAINT_MACHINE_CHECK             (1u << 1)
> #define TAINT_ERROR_INJECT              (1u << 2)
> #define TAINT_HVM_FEP                   (1u << 3)
> -#define TAINT_MACHINE_UNSECURE          (1u << 4)
> +#define TAINT_MACHINE_INSECURE          (1u << 4)
> #define TAINT_CPU_OUT_OF_SPEC           (1u << 5)
> extern unsigned int tainted;
> #define TAINT_STRING_MAX_LEN            20
> 
> base-commit: 67fdffef9246c82cecd8db28838ed09e79e2528a
> -- 
> 2.30.2
> 


 


Rackspace

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