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

Re: [PATCH CPU v2] cpuid: initialize cpuinfo with boot_cpu_data


  • To: Norbert Manthey <nmanthey@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Feb 2022 09:35:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=afKhXFrMDhUUQ7oYTlAQJHdkIdmbKvx8UuZLSRateHE=; b=grWtPw+7aKMlkEsMW9KuYhQ4/8Cr/C3me0eXmLPVzlQEkZXPtdmUYYsndcrXFPHSiLgMjIWjeDo1lALFfcy4FSGVkQdbt9TX9A7fKiME4p5/6koncZj7QoVqwQoFYhrc7s+9MxaW2DAUiIQqvIhs9sacPdN13PdzcMGqXseVg65iANvBETI58ZfgpG7DdYk0yxqiHTnOAZnfNnixsQqtdvXv3b47+2P6bN0l93EShg4HinpcF9g+ynx8bitj7Sh39JiOTKk8ZvJTSmv7K3gW13zPdWBn8pKGE08hvHJ/0qT1GR9JRu3NIk/4QwGLWQwCwee1IsPcg9XbGVp8aIpg/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fqVwa5LcUDNRiPXHA1UBvJaY+Qgp06SaAnXqeMF3FmzwyzS61ZWxpjK8LvdwBzOAqxwO12HsZUASNTvH4avC0jz8hDTzfCRRqWeLxeqptupTkQoH0tfAn3p31DSYvYwTwO8nnf2CWpp4UB32sU06nrAAxelKBPWGbzYwov1B8jbQ1whrl19fDFGVzxXjXIkVkZidRSpDI2L5GNc4l+lq4X8Vt5nDKyHQ5U0RWvxSKyLTucA9iIimMqk88WGATFRrFlq2xUjxNnaSxnVSxZW9Ytd4+j1vo3xrXDELyJyBOkSI95GyE595oQQYOhXzL/iOmjrxljVG6FgB/PsNwPjx2w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 14 Feb 2022 08:36:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.02.2022 16:25, Norbert Manthey wrote:
> When re-identifying CPU data, we might use uninitialized data when
> checking for the cache line property to adapt the cache
> alignment. The data that depends on this uninitialized read is
> currently not forwarded.
> 
> To avoid problems in the future, initialize the data cpuinfo
> structure before re-identifying the CPU again.
> 
> The trace to hit the uninitialized read reported by Coverity is:
> 
> bool recheck_cpu_features(unsigned int cpu)
> ...
>     struct cpuinfo_x86 c;
>     ...
>     identify_cpu(&c);
> 
> void identify_cpu(struct cpuinfo_x86 *c)
> ...
>     generic_identify(c)
> 
> static void generic_identify(struct cpuinfo_x86 *c)
> ...
>         if (this_cpu->c_early_init)
>                 this_cpu->c_early_init(c); // which is early_init_intel
> 
> static void early_init_intel(struct cpuinfo_x86 *c)
> ...
>     if (c->x86 == 15 && c->x86_cache_alignment == 64)
>         c->x86_cache_alignment = 128;
> 
> This bug was discovered and resolved using Coverity Static Analysis
> Security Testing (SAST) by Synopsys, Inc.
> 
> Signed-off-by: Norbert Manthey <nmanthey@xxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>




 


Rackspace

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