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]
Message-ID: <dd76524b-34d4-4092-bb04-0f7bd45f7c5c@amd.com>
Date: Thu, 12 Sep 2024 10:19:53 +0530
From: Vasant Hegde <vasant.hegde@....com>
To: Qianqiang Liu <qianqiang.liu@....com>, suravee.suthikulpanit@....com,
 will@...nel.org
Cc: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: Should the return value of the rlookup_amd_iommu be checked?

Hi,


On 9/12/2024 10:12 AM, Qianqiang Liu wrote:
> Hi,
> 
> I reviewed the following code:
> 
> 1592 void amd_iommu_update_and_flush_device_table(struct protection_domain *domain)
> 1593 {
> 1594 	struct iommu_dev_data *dev_data;
> 1595 
> 1596 	list_for_each_entry(dev_data, &domain->dev_list, list) {
> 1597 		struct amd_iommu *iommu = rlookup_amd_iommu(dev_data->dev); <-
> 1598 
> 1599 		set_dte_entry(iommu, dev_data); <-
> 1600 		clone_aliases(iommu, dev_data->dev);
> 1601 	}
> 1602 
> 1603 	list_for_each_entry(dev_data, &domain->dev_list, list)
> 1604 		device_flush_dte(dev_data);
> 1605 
> 1606 	domain_flush_complete(domain);
> 1607 }
> 
> The "rlookup_amd_iommu" function may return NULL, and the "set_dte_entry" function
> will call "get_dev_table" which will dereference the NULL pointer.
> 
> Is this an issue that may cause panic? Or will "rlookup_amd_iommu" function never
> return NULL?

During init driver will initialize rlookup_table. rlookup_amd_iommu will not
return NULL. So its fine.

-Vasant

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ