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

Re: [for-4.18][PATCH] xen/arm: Check return code from recursive calls to scan_pfdt_node()


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Tue, 17 Oct 2023 01:15:18 +0000
  • Accept-language: zh-CN, 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=V0Qe752MZB4CTFUeNhrJEhLqxP6sgxdTF5/1tTj4gXo=; b=OZhiMeCL71UAMe+Iq5zmbHXVZtsmMZLH1BNcDFTPYIaS5jrhbOCoY5YLvHXAOLc5yetUB7WdMmMjKlwAXlI7NeWLc8FSWnwEF5eD8jlvVeN6NWMJky0at30L+kO4EqMDP7W1srzl2ixS3veBvgDedeCbIC8W7tlfw42WnOcEjNBJh+ohx9kC0CwNnwmZRdQx5fXEU78afaU9hCI7bDMZYcBktSNauJ9rQki0aCBngjImPxsQaabVGBIQVbaGYQT/wUEiVquf8Sw1+Ss7sZfYjBBWIQOxx4H6+SGwwwrsXmtTRY0yjOAMLMSS2q0myqMm8XXKOseZDyO07GjuhVtWSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhag310WyLy5UFLCEHdVLiZ+lWfPfInOB+NFHY0UsPUC/0EWVVsm3rJrRlabw27tD2+BeGeTfM4wK5DoyTP5c4bH0XYMQ984E4ElRv8F6b8Xo+/wquq6AE+iCY8F5MmtTOcPal31DIOhrK6ZqAu8Wf/YLJeBZtB6RnhL7VclXmGUhA9Cz1kVAEjUKBnJGlNDscVP+95qb++rIKW0pRj/rQgV0QCBWao9AUhzRnI4JLoJCHNZKie9ISetFGD9CSYreaWU/UAEXnA8362Pua+EMDNxbBZx46/sCY/b5okk8r+yWbV8VIpvWQx9sX/mbApCm9QhC278/LKs7KluuYbX6Q==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 17 Oct 2023 01:24:24 +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: AQHaAC7LgeSduU1uk0uBgC7r5iKuprBMaPIAgADFa4A=
  • Thread-topic: [for-4.18][PATCH] xen/arm: Check return code from recursive calls to scan_pfdt_node()

Hi Michal,

> On Oct 16, 2023, at 21:28, Bertrand Marquis <Bertrand.Marquis@xxxxxxx> wrote:
> 
> Hi Michal,
> 
>> On 16 Oct 2023, at 14:45, Michal Orzel <michal.orzel@xxxxxxx> wrote:
>> 
>> At the moment, we do not check a return code from scan_pfdt_node()
>> called recursively. This means that any issue that may occur while
>> parsing and copying the passthrough nodes is hidden and Xen continues
>> to boot a domain despite errors. This may lead to incorrect device tree
>> generation and various guest issues (e.g. trap on attempt to access MMIO
>> not mapped in P2M). Fix it.
>> 
>> Fixes: 669ecdf8d6cd ("xen/arm: copy dtb fragment to guest dtb")
>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> 
> Good finding :-)
> 
> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry

> 
> Cheers
> Bertrand
> 
>> ---
>> @Henry:
>> This is a bug fix, so I think we should have it in 4.18 given the possible
>> consequences I described in the commit msg. I don't see any risks as this 
>> change
>> only checks the return code for an error.
>> ---
>> xen/arch/arm/domain_build.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>> 
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 24c9019cc43c..49792dd590ee 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -2872,8 +2872,11 @@ static int __init scan_pfdt_node(struct kernel_info 
>> *kinfo, const void *pfdt,
>>    node_next = fdt_first_subnode(pfdt, nodeoff);
>>    while ( node_next > 0 )
>>    {
>> -        scan_pfdt_node(kinfo, pfdt, node_next, address_cells, size_cells,
>> -                       scan_passthrough_prop);
>> +        rc = scan_pfdt_node(kinfo, pfdt, node_next, address_cells, 
>> size_cells,
>> +                            scan_passthrough_prop);
>> +        if ( rc )
>> +            return rc;
>> +
>>        node_next = fdt_next_subnode(pfdt, node_next);
>>    }
>> 
>> --
>> 2.25.1
>> 
> 




 


Rackspace

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