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

Re: [PATCH][4.17] x86/shadow: drop (replace) bogus assertions


  • To: Henry Wang <Henry.Wang@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 24 Oct 2022 15:36:42 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=fQVVnHeufOgRvgilYAy2o7HB/4N387WL7jJGgdpiO3k=; b=nffkiqyqWMPpAl+MTC1U2hU7YArtHjzrurwtGJjYICmvdEW1zNmsINUdaGA4op5vkDZpSH6XcT1CZ9wnNSwHgtIx7C70ufHrEA2DxqSKYiylkcWM9rcuJZTrwd8jgoRX6bmQ9Ot/PshlYcrnG3BoXmmFrQx9Mxz9RE06KGEwsl2yo3Umj9RaqcYSRUKF6a8ycBJXmOeNl5lwwt8lTHToLfNwRSdxNDb9/q51hM8PQX0HJfJb9VNFwgv5bYMnbWx3Qr9Bt9TlHFpPPRXyMtUH0IajhROxoVR3G/mOcQ+2i8a8lGeOGjUEnW/SuCi4Csk6Fgpl48Y9b1VThhF71++CYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PyqPWmJS8gcfLjmGOCu+8PFQzgZpTKV5Fg42YCwD6QenGiEOhF0bHKK0tr59GuKN8UMviqlhTll+kfClJdyR4cu+g9+eT3zhv8lkCNmQVe6VXaaYpsC9kb5ObMU7Yl+7raimwCapf9Ll0HshbSqH8adww6rWF94gV6lX+cfFOOSa6etIzxFkLKjWVTtYUk/UiZgSOVdcxoHddNreiUqe/FWf8Z9XDVUqUv0nJRwllrKIC7sZS2EQchv3tfK3diFZsb3B3UAeefEpbARG9RfQd/J1WzVZZxHLrKZS9hUEkft4jQatmQI5zXBLew84ZrogP+LTm4yLJQXvOAiDHvHebw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Tim Deegan <tim@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 24 Oct 2022 13:36:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.10.2022 12:30, Roger Pau Monné wrote:
> On Fri, Oct 14, 2022 at 10:49:55AM +0200, Jan Beulich wrote:
>> The addition of a call to shadow_blow_tables() from shadow_teardown()
>> has resulted in the "no vcpus" related assertion becoming triggerable:
>> If domain_create() fails with at least one page successfully allocated
>> in the course of shadow_enable(), or if domain_create() succeeds and
>> the domain is then killed without ever invoking XEN_DOMCTL_max_vcpus.
>>
>> The assertion's comment was bogus anyway: Shadow mode has been getting
>> enabled before allocation of vCPU-s for quite some time. Convert the
>> assertion to a conditional: As long as there are no vCPU-s, there's
>> nothing to blow away.
>>
>> Fixes: e7aa55c0aab3 ("x86/p2m: free the paging memory pool preemptively")
>> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>
>> A similar assertion/comment pair exists in _shadow_prealloc(); the
>> comment is similarly bogus, and the assertion could in principle trigger
>> e.g. when shadow_alloc_p2m_page() is called early enough. Replace those
>> at the same time by a similar early return, here indicating failure to
>> the caller (which will generally lead to the domain being crashed in
>> shadow_prealloc()).
> 
> It's my understanding we do care about this because a control domain
> could try to populate the p2m before calling XEN_DOMCTL_max_vcpus, and
> hence could trigger the ASSERT, as otherwise asserting would be fine.
> 
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

In a discussion amongst maintainers we've settled Andrew's reservations.
May I please ask for a release-ack for this change, so it can go in (as
a bug fix on top of the recent batch of XSAs)?

Thanks, Jan



 


Rackspace

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