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: <aYXu33WW8EqbXTlb@stanley.mountain>
Date: Fri, 6 Feb 2026 16:38:39 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: iommu@...ts.linux.dev, linux-kernel <linux-kernel@...r.kernel.org>
Subject: [bug report] iommu/amd: Introduce gDomID-to-hDomID Mapping and
 handle parent domain invalidation

[ Smatch checking is paused while we raise funding.  #SadFace
  https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]

Hello Suravee Suthikulpanit,

Commit 757d2b1fdf5b ("iommu/amd: Introduce gDomID-to-hDomID Mapping
and handle parent domain invalidation") from Jan 15, 2026
(linux-next), leads to the following Smatch static checker warning:

	drivers/iommu/amd/nested.c:161 amd_iommu_alloc_domain_nested()
	warn: 'gdom_info->hdom_id' unsigned <= 0

drivers/iommu/amd/nested.c
    148         /* Check if gDomID exist */
    149         if (refcount_inc_not_zero(&gdom_info->users)) {
    150                 ndom->gdom_info = gdom_info;
    151                 xa_unlock(&aviommu->gdomid_array);
    152 
    153                 pr_debug("%s: Found gdom_id=%#x, hdom_id=%#x\n",
    154                           __func__, ndom->gdom_id, gdom_info->hdom_id);
    155 
    156                 return &ndom->domain;
    157         }
    158 
    159         /* The gDomID does not exist. We allocate new hdom_id */
    160         gdom_info->hdom_id = amd_iommu_pdom_id_alloc();
--> 161         if (gdom_info->hdom_id <= 0) {

gdom_info->hdom_id is unsigned.  amd_iommu_pdom_id_alloc() can't return
zero.  It either returns negatives or 1-65535.

    162                 __xa_cmpxchg(&aviommu->gdomid_array,
    163                              ndom->gdom_id, gdom_info, NULL, GFP_ATOMIC);
    164                 xa_unlock(&aviommu->gdomid_array);
    165                 ret = -ENOSPC;
    166                 goto out_err_gdom_info;
    167         }
    168 
    169         ndom->gdom_info = gdom_info;

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ