From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796179976; b=nj8SuEraBdgwcwxVHMwKlpymWZJb+xNFzulJ1jNmZ0Z8LEtPJ5O3bruJivbO6ib3A8Dn xIjbVXAPCEzBdfw7igmmDePiMx5upwgrlhJMDe5UYKDlmD9RsN0FaWFMPhRiN+7C5QNdD ct1XUFSVW/YLbMSXrBSAdIvw1KynivLWcX3EtTobs4p5nfwMLcaKIP7wodPepfyZdsLQ/ Nq8Yh2QX1pl/B5K3xUM6xcqXnYHMobbvPvwTEbPn7tpeljE9Ko+iT7SLYgDG8PELUQt4C lhgsuPVFQVqNc0xi+PkM2ZiSS0NbXKyk05lMLZjuF/Yu4y8m5hcGj6lBUwFQE7fk3sg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796179976; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=oIbhhnjo8euQwlT8g4NdaOdfoNZN/F9hM/tgeeOV0QA=; b=u9aw0zKXNgMuggMilHf+QXeGHPd+bvUHFuaJprLPhTJDr30WpkZNMJlVXFJYB/jK/NA3 QQoLQmv1BMIVEh3dz66vOi4hj7bgbgPmYjcO1mEDBvOi650S+xeqx0L9owtjyD1Q79lvs KWP+70+iucMFspXUUYam7rdMm1VdkZ7qoY+vP/EFe7ZUP0LksQXzgBUnsT8SVSaLGJZEC MVHUSflZ6iS8MdM5c9zBbmCWrlSGRjdxdtP8tryRv4YJ3IjSDqcZNB9tNeYcN4Q1B1Rfs U8WkYOaR7fAtuM09ygF5/5k9+7UD+YItdVZEZPvQfP8g+qf9usbLvXJ+hqWBloIBErA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=Bgi493cD; arc=none smtp.remote-ip=209.85.214.174 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E249606A32E for ; Wed, 2 Dec 2026 02:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9E249606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=Bgi493cD Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2f146d5607aso19795ad.0 for ; Tue, 01 Dec 2026 18:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796179975; x=1796784775; darn=lists.linux.dev; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=oIbhhnjo8euQwlT8g4NdaOdfoNZN/F9hM/tgeeOV0QA=; b=Bgi493cDQZGSds2ohG6siRCecU5Ir0dE18UCWWoVE++3DkbesuLeo4oWjEyzR6at3L QFDDRIJ2WZZpNBEwL5S6kf7S86Qw+bevhJLIMrzCvojB3LSJddCf/fiq/XhKUFOFLDUQ 4D4xZD/dav9Oouc4eu0im1PCHXOVoYLtT1dX/+Al56QMqUz4DD+chxINL7ydPF5PmNsL OylBtgRy67usRjwT+I2JeP/Ts2GnbGGZCLouk+ipZHZZ78/RYqsUuMFV+PI0EsMkziVH 0CPxVcMMWPcVxaifgsAA72xvAHCt6JdeM0cDu26lU4bdHPnPJYJ8tib6WFsTf/pxjgOp ZwJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796179975; x=1796784775; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=oIbhhnjo8euQwlT8g4NdaOdfoNZN/F9hM/tgeeOV0QA=; b=c2S/YklB+TqEie9etGklW9vZ5m1XufZOewj310q8cYCNMFImT12QpGNtB1iVx/t/W/ gyu5AyaIwMe/Iz1HaLLp+Hy/ZBYMPRtv4YoIZEFf+3N9UhcH9eUtoOV03PyVMV+lsfWG lsMxPktvBELhcyLFV4GGHNjP/e39mctd3MAqnJ2oh41EQ3eUEj25+yFF/LSVy/TejXAm H+Zk/wTbrtGgxEkF5JgsAvs+17cPoAeo9RdJvwbbyWVPfdm4w7MNoQLqFw4SlccuCfSx GrZuUbvFiYms4Q1QgS5kxMTtvNniJwlcrEBU7UJ+YJwZQJseiyW4bwYo8XyauGqQ7uyT QxPQ== X-Forwarded-Encrypted: i=1; AL+hErFCWrFYbBIjuuZaFvAPZIf+iqA3q3e/axCQh4h1S7fFXQbrR1M7cCYpShR8URACJUoL8VtmhA==@lists.linux.dev X-Gm-Message-State: APuU4Z9RuPQqp7fvkm5/hA4gJyE4gEIf8HqL+ti8TwYjrCfBigqckdeI tIn/kVdtqHUbIvXw5K1nB/SE/SKmtpUDsNrA1QDir4JYqW5ZHQ30PiByxUbvN/wJlCPylXBB/z3 lQYi6CQ== X-Gm-Gg: AZFdTZe5Ibmj3pj+QYw6IP4JlzkpD9r6oyrWCqfd4OODRnQ+8qkSZjO0s43nRawXoFB +pBI83MwdvrIHJErfsIo4jeTpTCoyjmsKTJa2Eq4/rqK4WsTYp1KNxRzfuj5GS0wHivVVAX+DUe WzekQSUlqalsTBEki0lPNHo9R9icTvU4nnved5+Ey0G/RsZ9lp22zKbyiEguIkPoy2H6pBPGZpZ CqAlsoY2YnHltgnFsvNZu8k/U+AP5hD0vFQdp2UXBlaIfX68+L8Eld+WhHWHa9/dFvDnActbIuh uB0ILLzjdB3OkR/Sfqqw777wF3RvL4feB9HE0nONlncgr6XAUDAYlougpm6mbLUjs7oY7T6dBEz xaX00/svYRTVUoCQurUidEZxThebnG0XQhHhWRDCBogk5/ZRaE+IVJUhBOoo4YUjdnz5f+9hlVp M0e8EwASNV1M3DwIdIxmsQWRvAC5XmELQPNB8sK1LfzuAY7ETJUNDZlfmfqabfLNncmXslv8RQi 7JAWk9Y0FGHVMx1UUZ2qFFlzHmH8deLC+iPHDI6Zx1mfilTmW37Tkxjj3UFtK4I3RMHK/TFMPIz EkdOEpIqasnddO1JZH/TN0OIWWAjySJcgBFjuRnGb2WZv68o08KFKoLkitqIDk/aaGdYatKN4A9 R258cmJbH1oQiQtATndb8 X-Received: by 2002:a17:902:ccce:b0:2ea:4a1:e8a4 with SMTP id d9443c01a7336-2f179ef551cmr997475ad.13.1796179974162; Tue, 01 Dec 2026 18:52:54 -0800 (PST) Received: from google.com (25.75.145.34.bc.googleusercontent.com. [34.145.75.25]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b44b7a8c64sm28124021a91.3.2026.12.01.18.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 18:52:53 -0800 (PST) Date: Wed, 2 Dec 2026 02:52:50 +0000 From: Samiullah Khawaja To: James Widner Cc: jgg@nvidia.com, kevin.tian@intel.com, iommu@lists.linux.dev Subject: Re: [BUG] iommufd: batch_to_domain() can map the wrong PFN at ULONG_MAX Message-ID: References: X-Mailing-List: iommu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Dec 01, 2026 at 06:20:47AM -0500, James Widner wrote: >Hello, > >I found an unsigned-wrap issue in iommufd’s `batch_to_domain()` >handling when an IOAS mapping ends at `ULONG_MAX`. Under the affected >mapping paths, the first PFN run can cover the following IOVA and >leave the final IOVA mapped to a page that was not requested by >userspace. > >The attached report explains the trigger, affected paths, current and >stable A/B results, limitations, and proposed fix. I have also >attached the proposed source diff for convenient review. > >I would appreciate your assessment of the finding and proposed fix. >Please retain reporter attribution to me in any resulting commit. > >This finding was researched and validated with Codex Daybreak and >DeepSeek 4.1 Heretic. I have reviewed the submission and take >responsibility for it. Hi, I was working on a fix for this one and was planning to send it today. Do you want to send the proposed fix or should I send my fix with you mentioned in Reported-by? Thanks, Sami