NetBSD Problem Report #60907

From www@netbsd.org  Tue Oct 20 13:01:34 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9BF771A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 20 Oct 2026 13:01:34 +0000 (UTC)
Message-Id: <20261020130133.714C71A923C@mollari.NetBSD.org>
Date: Tue, 20 Oct 2026 13:01:33 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: i915: partial page view indexing error
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         60907
>Category:       kern
>Synopsis:       i915: partial page view indexing error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 20 13:05:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Tue Oct 20 13:35:01 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10
>Organization:
The PartialGGTT Overrun, Inc.
>Environment:
>Description:

	The logic in intel_partial_pages takes an object with a DMA map
	for pages [0,n) and a view [offset,offset+size) with

		0 <= offset <= offet + size <= n

	and creates a DMA map just for pages [offset,offset+size).

	However, owing to an indexing error, it may create some bogus
	addresses past the end of one of the segments.

	In particular, if the object has a segment {.ds_addr, .ds_len}
	for the left part of pages [offset,offset+size) so that the
	partial view requires taking the right part from the next
	segment, some of the pages in the middle might be instead taken
	to be .ds_addr + .ds_len, .ds_addr + .ds_len + PAGE_SIZE,
	.ds_addr + .ds_len + 2*PAGE_SIZE, and so on.

>How-To-Repeat:

	code inspection

>Fix:

-			    k < iseg->ds_len >> PAGE_SHIFT);
+			    k < (iseg->ds_len - offset) >> PAGE_SHIFT);

	plus some assertions to sanity-check the arithmetic

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 20 Oct 2026 13:28:52 +0000
State-Changed-Why:
HEAD, probably needs pullup-11 and pullup-10 after some testing


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60907 CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Date: Tue, 20 Oct 2026 13:30:14 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Oct 20 13:30:14 UTC 2026

 Modified Files:
 	src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_ggtt.c

 Log Message:
 i915: Fix partial page view indexing error.

 PR kern/60907: i915: partial page view indexing error


 To generate a diff of this commit:
 cvs rdiff -u -r1.19 -r1.20 \
     src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.