From nobody Tue Nov 17 17:21:47 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jTWk34fNqz71VBL for ; Tue, 17 Nov 2026 17:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTWk338cyz4qHc for ; Tue, 17 Nov 2026 17:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794936107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPUg+umFJe2Wf56bINm+4niY3Yj2eJ8Jwl57Yrof5iY=; b=pan/HQ6LYRKLw8t5uTUzbeWwLf60uZsQZKDn0tHfxppIv4LIBRj+OonOEeIZxJiDxPpc9M f0G4eLABOnC9pafjiJz0Luz4iPiZet+Mddz7fFerm7ToRoAzehcLKXy7d9tgrVoBs/FQyf LJjWBZ77mNSMniL0fy0c6yM26559SJvfDBEFKpFpPgn1GlNyxTKz5mIj0y+NEh67KtRqIL 39A5WqW4D1xOxQoPRO5jzbFLHGNmFpJkvIQI+ZP9qZpnViUEjPx/+KXuILaLZpUxWvf+ki UAZh3euqnIeN3JVPvkz3js7fyyU/LE7NA8tEdaNX2T4eRRLpSiPDHEaHpruV7w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794936107; b=cPbK5npt1w6nS4jE3J6kg0L7+tDXZPgOfFAbgLaAusfIJLfDI6oPK7GObWvKvHQ8gSCXG9 yBszGdlXEQ+z2WXbvoUGfex6aRrGYbE+mExmJHSq8kIVlLZZB8U94xuxxFcNXh5nexi1Bm sCLr9QkUqnIN3aCSPIGs8XgrmXoTrwunqABj+apUVZyZ4b4TazFlqc2SPAocMHSMeaxibN x+2lbobDFJ56oQ3PtPxw+fzzpIO5xGUClhT2VwbatjQNo+lgrOlEwJYIvqoCOKgRobli/h s1bXCpYLI08tugwADFwvG7bnJdsMWdok+lIEn2c0zson9nteq606zsxPqnnmaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794936107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPUg+umFJe2Wf56bINm+4niY3Yj2eJ8Jwl57Yrof5iY=; b=KvVSscdXzMWo4AOH4yCgHU9tqZqLcSVyBOq2NTIZI61kqXeD2BpQEbWxMZbAFpQIIi3ek3 OwV6HNvnLuX9lEAJMchpyEteISl6GOAUs0QdsjwR23jID17tW00u3NlB4J8M6qLSrQJgyN DDn+dDg83Aun1ug/XU19QxHMI16HamLzVaDc4uETqPm5zFnfrbp5DPPStHxBBJoH/j5BGc uVWLQLb4bj27jqnBaAHzYW1KMj2wOZuST/Ko8BP3lnUfbTZYF6xnNKuXVIhOopXKKnB/LK /8u3b5i6PgEYj0yfvjqXN87sJceh88yOkKWo/O+E7n+svGeHFNEdHIZCZSL7Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTWk32mmBzrrK for ; Tue, 17 Nov 2026 17:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f3e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:21:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Austin Shafer Subject: git: 6b1e53ad7f65 - main - sglist: use u_int instead of u_short to store sizes List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ashafer X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b1e53ad7f65fe0fd71f01462458eada212995b2 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:21:47 +0000 Message-Id: <6afc8d2b.f3e.7df4318e@gitrepo.freebsd.org> The branch main has been updated by ashafer: URL: https://cgit.FreeBSD.org/src/commit/?id=6b1e53ad7f65fe0fd71f01462458eada212995b2 commit 6b1e53ad7f65fe0fd71f01462458eada212995b2 Author: Austin Shafer AuthorDate: 2026-11-04 17:04:59 +0000 Commit: Austin Shafer CommitDate: 2026-11-17 17:08:33 +0000 sglist: use u_int instead of u_short to store sizes sglist_alloc accepts an int argument to specify the number of segments in the sglist. The sglist struct however stores this value in a u_short, which may wrap in the case of larger sglists. This happens when the NVIDIA driver performs large allocations, as reported by a user. This changes updates the use of u_short to a u_int to match the arg passed into sglist_alloc. The sglist init and save locations are also updated to no longer use shorts to represent nseg. Approved by: khng (mentor) PR: 299611 Sponsored by: NVIDIA Differential Revision: https://reviews.freebsd.org/D61197 --- sys/kern/subr_sglist.c | 2 +- sys/sys/sglist.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_sglist.c b/sys/kern/subr_sglist.c index a7162d4d151c..5646fd3bd096 100644 --- a/sys/kern/subr_sglist.c +++ b/sys/kern/subr_sglist.c @@ -56,7 +56,7 @@ static MALLOC_DEFINE(M_SGLIST, "sglist", "scatter/gather lists"); * that can occur to the ending segment is that it can be extended. */ struct sgsave { - u_short sg_nseg; + u_int sg_nseg; size_t ss_len; }; diff --git a/sys/sys/sglist.h b/sys/sys/sglist.h index 3bbada573772..5f021da622ab 100644 --- a/sys/sys/sglist.h +++ b/sys/sys/sglist.h @@ -49,8 +49,8 @@ struct sglist_seg { struct sglist { struct sglist_seg *sg_segs; u_int sg_refs; - u_short sg_nseg; - u_short sg_maxseg; + u_int sg_nseg; + u_int sg_maxseg; }; struct bio; @@ -59,7 +59,7 @@ struct thread; struct uio; static __inline void -sglist_init(struct sglist *sg, u_short maxsegs, struct sglist_seg *segs) +sglist_init(struct sglist *sg, u_int maxsegs, struct sglist_seg *segs) { sg->sg_segs = segs;