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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Aug 2017 11:37:40 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     Artem Savkov <asavkov@...hat.com>,
        Will Deacon <will.deacon@....com>
Cc:     iommu@...ts.linux-foundation.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iommu/arm-smmu: fix null-pointer dereference in
 arm_smmu_add_device

On 08/08/17 11:26, Artem Savkov wrote:
> Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device"
> removed fwspec assignment in legacy_binding path as redundant which is
> wrong. It needs to be updated after fwspec initialisation in
> arm_smmu_register_legacy_master() as it is dereferenced later. Without
> this there is a NULL-pointer dereference panic during boot on some hosts.

Reviewed-by: Robin Murphy <robin.murphy@....com>

Thanks for fixing it up, and sorry for failing to document the
unfortunately subtle logic in the first place!

Robin.

> Signed-off-by: Artem Savkov <asavkov@...hat.com>
> ---
>  drivers/iommu/arm-smmu.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index b97188a..2d80fa8 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1519,6 +1519,13 @@ static int arm_smmu_add_device(struct device *dev)
>  
>  	if (using_legacy_binding) {
>  		ret = arm_smmu_register_legacy_master(dev, &smmu);
> +
> +		/*
> +		 * If dev->iommu_fwspec is initally NULL, arm_smmu_register_legacy_master()
> +		 * will allocate/initialise a new one. Thus we need to update fwspec for
> +		 * later use.
> +		 */
> +		fwspec = dev->iommu_fwspec;
>  		if (ret)
>  			goto out_free;
>  	} else if (fwspec && fwspec->ops == &arm_smmu_ops) {
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ