lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YmpN1ZVZMrU9ZJ3e@8bytes.org>
Date:   Thu, 28 Apr 2022 10:18:29 +0200
From:   Joerg Roedel <joro@...tes.org>
To:     cgel.zte@...il.com
Cc:     will@...nel.org, iommu@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, Lv Ruyi <lv.ruyi@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] iommu: add null pointer check

On Tue, Mar 29, 2022 at 05:53:22AM +0000, cgel.zte@...il.com wrote:
> From: Lv Ruyi <lv.ruyi@....com.cn>
> 
> kmem_cache_zalloc is a memory allocation function which can return NULL
> when some internal memory errors happen. Add null pointer check to avoid
> dereferencing null pointer.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
> ---
>  drivers/iommu/fsl_pamu_domain.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
> index 69a4a62dc3b9..43849c027298 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -152,6 +152,10 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
>  	}
>  
>  	info = kmem_cache_zalloc(iommu_devinfo_cache, GFP_ATOMIC);
> +	if (!info) {
> +		spin_unlock_irqrestore(&device_domain_lock, flags);
> +		return;
> +	}

Such errors need to be propagated.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ