[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] arm/efi: Fix null pointer dereference
- To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Mon, 11 Oct 2021 09:37:44 +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=6ElrMXzpdlSNruvcRylv8x2LgXKxe7aDYpMZgWR9LEo=; b=Az2OdAqoD5I8wAaGDNJqvxDfyoh6MkUBgf/3EH1pJlVrPVdwnofnBZm/5ZrXyRhfaLQY59tGlATgRhocb3gc+zwKF2m+TZKoLaUkBUs0aWQV4EQEk0ev3P4FJYNS0yD/0kIlU4FPE+XDdXHdS083IO4mM/7rqUG9YqF3lFKmgk9VGqfcj69wD9pLLrbJDkPeP4A/wG/feIFZkhLDLNO4uRF8E0zpASQbTntKUAMKrrs23zcy94U9Topr4s15K0UHSNJ8ahlBAYW4qq5i4O8AQjbJeRNOmg1uhBA96xJcUephWM3vO9WTiPTllZeivkzuntVogtrPMDzf7sT/6cjHGw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IIdgeYkYQo5v2RlbB0VvUP/cT3r/OkXlrufIzxP8kxZNJsozw6Snbhn2zW14nRYt2OIzFYs5kx+p7SpjyN3nwINImry3GyWhWAxIqXhIg9nIdtqOfnYy77mtcIxlp4Uh0I2Fic1IUdG6SM1ceZIkMO0wV4+cd17irfbhzFq2Jp5XrF05C0+VFEpwCCroU3NtamPvsry2XN8/LY7LeZ65jDlRnXvccUXaJzVZY/ZEgXcfbXxEn9dYC5x4p+Edxw37KH3zcbg8P2lBkqv/5zKxglFK+RbEnlJtUIQZP7haoaffE7XK8rYbof3diNU7hYvtkA+yqXXXlM1tOeO2LPMm6A==
- Authentication-results-original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 11 Oct 2021 09:38:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Thread-index: AQHXvnWYcaBPG2QbfEGAFop12nzuY6vNilyA
- Thread-topic: [PATCH] arm/efi: Fix null pointer dereference
Hi Luca,
> On 11 Oct 2021, at 08:56, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
>
> Fix for commit 60649d443dc395243e74d2b3e05594ac0c43cfe3
> that introduces a null pointer dereference when the
> fdt_node_offset_by_compatible is called with "fdt"
> argument null.
>
> Reported-by: Julien Grall <julien@xxxxxxx>
> Fixes: 60649d443d ("arm/efi: Introduce xen,uefi-cfg-load DT property")
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Cheers
Bertrand
> ---
> xen/arch/arm/efi/efi-boot.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
> index a3e46453d4..e63dafac26 100644
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/efi/efi-boot.h
> @@ -593,7 +593,8 @@ static bool __init
> efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
> dtbfile.ptr = fdt;
> dtbfile.need_to_free = false; /* Config table memory can't be freed. */
>
> - if ( fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") > 0 )
> + if ( fdt &&
> + (fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") > 0) )
> {
> /* Locate chosen node */
> int node = fdt_subnode_offset(fdt, 0, "chosen");
> --
> 2.17.1
>
|